/* ============================================================
   STOP HARCÈLEMENT — Programme pHARe — version libre
   Style : sobre, institutionnel, rassurant, dominante turquoise.
   ============================================================ */

:root {
  --phare-deep:    #0F4C4A;
  --phare:         #00A99D;
  --phare-soft:    #4FC3B8;
  --phare-pale:    #DDF1EE;
  --phare-bg:      #F4FAF9;
  --ink:           #122524;
  --ink-soft:      #4A5E5C;
  --line:          #D7E7E4;
  --warm:          #E07A5F;
  --warm-soft:     #F4D5C9;
  --gold:          #C9A14A;
  --paper:         #FFFFFF;
  --shadow-card:   0 6px 24px -8px rgba(15, 76, 74, 0.18), 0 2px 6px rgba(15, 76, 74, 0.06);
  --shadow-soft:   0 2px 10px -4px rgba(15, 76, 74, 0.12);
  --radius-lg:     22px;
  --radius-md:     14px;
  --radius-sm:     10px;
  --font-display:  'Fraunces', Georgia, serif;
  --font-body:     'Lexend', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--phare-bg);
  min-height: 100vh;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 10% 0%, rgba(0,169,157,0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 100%, rgba(15,76,74,0.06) 0%, transparent 50%);
  background-attachment: fixed;
}

#app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  min-height: 100vh;
}

/* ===== Screens ===== */
.screen {
  display: none;
  animation: fadeUp .45s ease-out;
}
.screen.is-active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--phare-deep);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
h2 { font-size: 2.25rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.1rem; }
.muted { color: var(--ink-soft); }
.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--phare);
  margin: 0 0 10px;
}

/* ===== Brand bar (logos) ===== */
.brand-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 4px 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 36px;
}
.logo-slot {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
}
.logo-slot img {
  height: 100%;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
}
.logo-slot--right img { max-width: 200px; }
.logo-slot__text {
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--phare-deep);
}

/* ===== Welcome screen ===== */
.welcome-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 24px 12px;
}
.title-display {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  line-height: 0.98;
  margin: 6px 0 22px;
  letter-spacing: -0.025em;
}
.title-display__line { display: block; color: var(--phare-deep); }
.title-display__line--accent {
  color: var(--phare);
  font-style: italic;
  font-variation-settings: "opsz" 144;
}
.lede {
  font-size: 1.18rem;
  color: var(--ink-soft);
  max-width: 540px;
  margin: 0 0 32px;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-row--end { justify-content: flex-end; margin-top: 28px; }
.cta-row--center { justify-content: center; margin-top: 28px; }
.credit-line {
  margin-top: 36px;
  font-size: 0.95rem;
  color: var(--ink-soft);
  padding: 14px 18px;
  background: var(--paper);
  border-left: 4px solid var(--phare);
  border-radius: var(--radius-sm);
  max-width: 540px;
  box-shadow: var(--shadow-soft);
}

.welcome-side { display: grid; gap: 18px; }
.info-card {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line);
}
.info-card h3 { font-size: 1.2rem; }
.info-card ul { padding-left: 18px; margin: 12px 0 0; color: var(--ink-soft); }
.info-card li { margin: 6px 0; }

.help-card {
  background: var(--phare-deep);
  color: #E8FFFB;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
}
.help-card__row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.help-card__row:last-child { border-bottom: none; }
.help-card__row .num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--phare);
  color: white;
  padding: 4px 14px;
  border-radius: 8px;
  min-width: 76px;
  text-align: center;
}

.footer {
  margin-top: 64px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.88rem;
}
.footer .sep { opacity: 0.5; }

/* ===== Buttons ===== */
.btn {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background-color .2s, border-color .2s, box-shadow .2s;
  letter-spacing: 0.01em;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn--primary {
  background: var(--phare-deep);
  color: white;
  box-shadow: 0 4px 14px -4px rgba(15,76,74,0.45);
}
.btn--primary:hover { background: var(--phare); }
.btn--ghost {
  background: transparent;
  color: var(--phare-deep);
  border-color: var(--phare-deep);
}
.btn--ghost:hover { background: var(--phare-pale); }
.btn--accent {
  background: var(--gold);
  color: var(--phare-deep);
  border-color: transparent;
  box-shadow: 0 4px 14px -4px rgba(201,161,74,0.45);
}
.btn--accent:hover { background: #DAB35F; }
.btn--small { padding: 8px 16px; font-size: 0.88rem; }
.btn--quiet {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}
.btn--quiet:hover { background: var(--paper); color: var(--phare-deep); }

/* ===== Panels (rules, end, debrief, teacher, about) ===== */
.panel {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 44px 48px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line);
  max-width: 880px;
  margin: 40px auto;
}
.panel--wide { max-width: 1100px; }

/* ===== Rules ===== */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 22px;
}
.rule {
  background: var(--phare-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  position: relative;
}
.rule__icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--phare);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 12px;
}
.rule p { color: var(--ink-soft); margin: 0; }
.rules-note {
  margin-top: 26px;
  padding: 18px 22px;
  background: var(--warm-soft);
  border-left: 4px solid var(--warm);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.96rem;
}

/* Sélecteur de niveau */
.level-picker {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.level-picker__options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.level-opt {
  text-align: left;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all .15s;
  font-family: var(--font-body);
}
.level-opt:hover { border-color: var(--phare-soft); background: var(--phare-pale); }
.level-opt.is-active {
  border-color: var(--phare-deep);
  background: var(--phare-pale);
  box-shadow: 0 4px 12px -6px rgba(15,76,74,0.3);
}
.level-opt__name {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--phare-deep);
  font-size: 1.05rem;
}
.level-opt__sub {
  font-size: 0.78rem;
  color: var(--phare);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 2px 0 6px;
}
.level-opt__desc { font-size: 0.85rem; color: var(--ink-soft); line-height: 1.4; }

@media (max-width: 720px) {
  .level-picker__options { grid-template-columns: 1fr; }
}

/* ===== Avatar reveal ===== */
.reveal-wrap {
  max-width: 720px;
  margin: 60px auto;
  text-align: center;
  padding: 0 16px;
}
.avatar-stage {
  margin: 40px 0;
  display: flex;
  justify-content: center;
}
.avatar-card {
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
  border: 1px solid var(--line);
  min-width: 380px;
  animation: popIn .5s cubic-bezier(.34,1.6,.64,1);
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.85); }
  to { opacity: 1; transform: scale(1); }
}
.avatar-svg-wrap {
  width: 160px;
  height: 200px;
  background: var(--phare-pale);
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}
.avatar-svg-wrap svg { width: 140px; height: auto; }
.avatar-meta {
  text-align: left;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.avatar-meta__label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--phare);
}
.avatar-meta__value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--phare-deep);
  margin-bottom: 8px;
}

/* ===== Role reveal ===== */
.role-card {
  margin: 36px auto;
  max-width: 540px;
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 32px 34px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  text-align: center;
  animation: popIn .6s cubic-bezier(.34,1.6,.64,1);
}
.role-card__badge {
  display: inline-block;
  background: var(--phare);
  color: white;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.role-card[data-role="harcele"]   .role-card__badge { background: var(--warm); }
.role-card[data-role="harceleur"] .role-card__badge { background: var(--gold); }
.role-card[data-role="temoin"]    .role-card__badge { background: var(--phare); }
.role-card__title { font-size: 2rem; margin: 4px 0 14px; }
.role-card__desc { color: var(--ink-soft); margin: 0; font-size: 1.05rem; }
.role-note {
  background: var(--phare-pale);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  color: var(--phare-deep);
  font-size: 0.95rem;
  max-width: 540px;
  margin: 0 auto;
}

/* ===== Game screen layout ===== */
.game-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 26px;
  align-items: start;
  padding: 4px;
}

/* HUD */
.hud {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 16px;
}
.hud__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.hud__avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--phare-pale);
  display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.hud__avatar svg { width: 46px; height: auto; }
.hud__name { font-family: var(--font-display); font-weight: 700; color: var(--phare-deep); font-size: 1.05rem; }
.hud__role { font-size: 0.8rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.08em; }
.hud__turn {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--phare-deep);
  text-align: center;
  margin-bottom: 18px;
  padding: 10px;
  background: var(--phare-pale);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}

.gauges { display: grid; gap: 12px; margin-bottom: 18px; }
.gauge { font-size: 0.85rem; }
.gauge__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 4px;
}
.gauge__label { color: var(--ink-soft); font-weight: 500; }
.gauge__value { color: var(--phare-deep); font-weight: 600; font-family: var(--font-display); }
.gauge__bar {
  height: 8px;
  background: var(--phare-pale);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.gauge__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--phare-soft), var(--phare));
  border-radius: 999px;
  transition: width .6s cubic-bezier(.4, 0, .2, 1);
}
.gauge--neg .gauge__fill {
  background: linear-gradient(90deg, var(--warm-soft), var(--warm));
}
.gauge__delta {
  position: absolute;
  right: 0; top: -22px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  animation: deltaPop .9s ease;
}
.gauge__delta--up { background: var(--phare-pale); color: var(--phare-deep); }
.gauge__delta--down { background: var(--warm-soft); color: var(--warm); }
@keyframes deltaPop {
  0%   { opacity: 0; transform: translateY(8px); }
  20%  { opacity: 1; transform: translateY(0); }
  80%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-6px); }
}

/* Board */
.board {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  min-height: 580px;
}
.board__head { margin-bottom: 18px; }
.board__loc-label {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--phare);
}
.board__loc-name { font-size: 1.6rem; margin: 4px 0 0; }

.board__map {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  background: var(--phare-bg);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}
.map-tile {
  flex: 1 1 auto;
  min-width: 80px;
  padding: 10px 6px;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-weight: 500;
  transition: all .3s;
}
.map-tile.is-active {
  background: var(--phare-deep);
  color: white;
  border-color: var(--phare-deep);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px -4px rgba(15,76,74,0.4);
}
.map-tile__icon { display: block; font-size: 1.2rem; margin-bottom: 2px; }

/* Scene */
.scene { min-height: 320px; }
.scene__inner { display: grid; gap: 20px; animation: fadeUp .4s ease-out; }

.scene__stage {
  background: linear-gradient(180deg, var(--phare-pale) 0%, #F8FCFB 100%);
  border-radius: var(--radius-md);
  padding: 24px;
  min-height: 220px;
  position: relative;
  border: 1px solid var(--line);
  overflow: hidden;
}
.scene__stage::before {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 30px;
  background: linear-gradient(180deg, transparent, rgba(15,76,74,0.08));
}
.scene__chars {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 30px;
  flex-wrap: wrap;
  min-height: 180px;
}
.char {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 240px;
  animation: charIn .5s cubic-bezier(.34,1.6,.64,1);
}
.char--right { animation-delay: .12s; }
@keyframes charIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.char__bubble {
  background: var(--paper);
  border: 1.5px solid var(--phare-deep);
  border-radius: 18px;
  padding: 10px 16px;
  font-size: 0.95rem;
  color: var(--ink);
  max-width: 240px;
  position: relative;
  box-shadow: var(--shadow-soft);
  font-weight: 500;
}
.char__bubble--think {
  border-style: dashed;
  background: var(--paper);
  font-style: italic;
  color: var(--ink-soft);
}
.char__bubble::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 30px;
  width: 16px; height: 16px;
  background: var(--paper);
  border-right: 1.5px solid var(--phare-deep);
  border-bottom: 1.5px solid var(--phare-deep);
  transform: rotate(45deg);
}
.char__bubble--think::after { border-style: dashed; }
.char__svg { width: 96px; height: 130px; }
.char__name {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-weight: 500;
}

.scene__narration {
  background: var(--paper);
  border-left: 4px solid var(--phare);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 1rem;
}
.scene__narration strong { color: var(--phare-deep); }

.choices { display: grid; gap: 10px; }
.choice {
  text-align: left;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--ink);
  cursor: pointer;
  transition: all .15s;
  font-weight: 500;
  line-height: 1.45;
}
.choice:hover {
  border-color: var(--phare);
  background: var(--phare-pale);
  transform: translateX(2px);
}
.choice:disabled { cursor: not-allowed; opacity: 0.5; }

.consequence {
  background: var(--phare-pale);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  animation: fadeUp .4s;
}
.consequence__title {
  font-weight: 600;
  color: var(--phare-deep);
  margin-bottom: 6px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.consequence__text { margin: 0 0 12px; color: var(--ink); }
.consequence__edu {
  font-size: 0.92rem;
  color: var(--phare-deep);
  padding: 10px 14px;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-sm);
  margin-top: 10px;
}
.consequence__edu strong { color: var(--phare-deep); }

/* ===== Badges de posture (achievements) ===== */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.badges-grid--catalog { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.badge {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: transform .2s;
}
.badge--earned {
  background: linear-gradient(135deg, #FFF8E5 0%, #FFFDF7 100%);
  border-color: var(--gold);
  box-shadow: 0 4px 14px -6px rgba(201,161,74,0.4);
}
.badge--earned:hover { transform: translateY(-2px); }
.badge__icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--phare-pale);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.badge--earned .badge__icon { background: var(--gold); color: white; }
.badge--catalog .badge__icon { background: var(--phare-bg); }
.badge__body { min-width: 0; }
.badge__title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--phare-deep);
  font-size: 1.02rem;
  margin-bottom: 3px;
  line-height: 1.2;
}
.badge__desc {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.4;
}
.badges-empty {
  background: var(--phare-pale);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  color: var(--phare-deep);
  font-size: 0.95rem;
  line-height: 1.5;
}
.badges-locked-hint {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
  text-align: center;
}
.debrief-block--badges { grid-column: 1 / -1; }

/* ===== Suivi des sessions (mode enseignant) ===== */
.sessions-stats__head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
  background: var(--phare-deep);
  color: #E8FFFB;
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 18px;
}
.sessions-stats__big { text-align: center; }
.sessions-stats__num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 3rem;
  line-height: 1;
}
.sessions-stats__label {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 4px;
}
.sessions-stats__meta {
  font-size: 0.9rem;
  display: grid;
  gap: 4px;
  padding-left: 18px;
  border-left: 2px solid rgba(255,255,255,0.18);
}
.sessions-stats__meta strong { color: var(--gold); }
.sessions-stats__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.sessions-stats__card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.sessions-stats__card h5 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--phare-deep);
  margin: 0 0 8px;
  letter-spacing: 0;
}
.sessions-stats__card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.88rem;
  display: grid;
  gap: 4px;
}
.sessions-stats__card li { color: var(--ink); }
.sessions-stats__card li strong {
  display: inline-block;
  min-width: 32px;
  color: var(--phare);
  font-family: var(--font-display);
}

/* ===== Rejeu pédagogique ===== */
#replay-moments { display: grid; gap: 28px; margin-top: 22px; }
.replay-moment {
  background: var(--paper);
  border-radius: var(--radius-md);
  padding: 28px 30px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  animation: fadeUp .45s ease-out;
}
.replay-moment--worst { border-left: 6px solid var(--warm); }
.replay-moment--best  { border-left: 6px solid var(--phare); }
.replay-moment__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 10px;
}
.replay-moment__pill {
  background: var(--warm);
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
}
.replay-moment--best .replay-moment__pill { background: var(--phare); }
.replay-moment__turn {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-weight: 600;
}
.replay-moment__title { font-size: 1.5rem; margin: 4px 0 8px; }
.replay-moment__narration {
  background: var(--phare-bg);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  margin: 0 0 18px;
  font-size: 0.98rem;
  line-height: 1.5;
}

.replay-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.replay-choice {
  position: relative;
  background: var(--phare-bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: grid;
  gap: 8px;
  transition: transform .15s;
}
.replay-choice:hover { transform: translateY(-2px); }
.replay-choice--played {
  background: linear-gradient(135deg, #FFF8E5 0%, #FFFDF7 100%);
  border-color: var(--gold);
  box-shadow: 0 4px 14px -6px rgba(201,161,74,0.4);
}
.replay-choice__badge {
  position: absolute;
  top: -10px;
  left: 14px;
  background: var(--gold);
  color: var(--phare-deep);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.replay-choice__head {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
}
.replay-choice__letter {
  width: 32px; height: 32px;
  background: var(--phare-pale);
  color: var(--phare-deep);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}
.replay-choice--played .replay-choice__letter { background: var(--gold); color: white; }
.replay-choice__label { font-weight: 600; color: var(--ink); font-size: 0.95rem; line-height: 1.3; }
.replay-choice__cons { font-size: 0.88rem; color: var(--ink); line-height: 1.45; }
.replay-choice__cons strong { color: var(--phare-deep); }
.replay-choice__edu {
  font-size: 0.85rem;
  color: var(--phare-deep);
  padding: 8px 10px;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-sm);
  line-height: 1.4;
}
.replay-choice__edu strong { color: var(--phare-deep); }
.replay-choice__deltas {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}
.delta {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  font-family: var(--font-body);
}
.delta--pos { background: var(--phare-pale); color: var(--phare-deep); }
.delta--neg { background: var(--warm-soft); color: var(--warm); }

/* ===== Vue duale (fossé de perception) ===== */
.scene__stage--dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  position: relative;
  background: linear-gradient(90deg, #FCE9E2 0%, #FCE9E2 50%, #E5F4F1 50%, #E5F4F1 100%);
  padding: 0;
  min-height: 260px;
  overflow: hidden;
}
.dual-divider {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(15,76,74,0.3);
  z-index: 2;
}
.dual-divider__label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  white-space: nowrap;
  background: var(--phare-deep);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
}
.dual-side {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.dual-side--left  { padding-right: 30px; }
.dual-side--right { padding-left: 30px; }
.dual-side__label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--phare-deep);
  background: rgba(255,255,255,0.7);
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-block;
  align-self: flex-start;
}
.dual-side--left .dual-side__label { color: var(--warm); }
.dual-side__chars {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex: 1;
  min-height: 130px;
}
.dual-side__chars .char__svg { width: 80px; height: 110px; }
.dual-side__narration {
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.45;
  background: rgba(255,255,255,0.75);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}
.scene__narration--dual {
  background: var(--phare-deep);
  color: #E8FFFB;
  border-left: 4px solid var(--gold);
}
.scene__narration--dual strong { color: white; }

body.is-class-mode .dual-side__narration { font-size: 1.02rem; }
body.is-class-mode .dual-side__chars .char__svg { width: 100px; height: 135px; }

@media (max-width: 720px) {
  .scene__stage--dual { grid-template-columns: 1fr; background: linear-gradient(180deg, #FCE9E2 0%, #FCE9E2 50%, #E5F4F1 50%, #E5F4F1 100%); }
  .dual-divider { left: 0; right: 0; top: 50%; bottom: auto; width: auto; height: 2px; }
  .dual-divider__label { transform: translate(-50%, -50%); }
  .dual-side--left  { padding: 16px 18px 30px; }
  .dual-side--right { padding: 30px 18px 16px; }
}

/* End screen */
/* End screen */
.pride-bar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
  background: linear-gradient(135deg, var(--phare-deep) 0%, #143A38 100%);
  color: #E8FFFB;
  border-radius: var(--radius-md);
  padding: 22px 26px;
  margin: 22px 0 0;
  box-shadow: 0 6px 20px -8px rgba(15,76,74,0.3);
  animation: fadeUp .5s ease-out;
}
.pride-bar--low      { background: linear-gradient(135deg, #6B4D40 0%, #4A332C 100%); }
.pride-bar--mixed    { background: linear-gradient(135deg, #B07B3A 0%, #8B5E2A 100%); }
.pride-bar--good     { background: linear-gradient(135deg, #00A99D 0%, #0F4C4A 100%); }
.pride-bar--excellent{ background: linear-gradient(135deg, #C9A14A 0%, #0F4C4A 100%); }
.pride-bar__left { text-align: center; min-width: 140px; }
.pride-bar__pill {
  background: rgba(255,255,255,0.18);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 10px;
}
.pride-bar__score { display: flex; align-items: baseline; gap: 6px; justify-content: center; flex-wrap: wrap; }
.pride-bar__num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 3.6rem;
  line-height: 1;
}
.pride-bar__total {
  font-family: var(--font-display);
  font-size: 1.4rem;
  opacity: 0.7;
}
.pride-bar__caption {
  display: block;
  width: 100%;
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 4px;
}
.pride-bar__right { padding-left: 20px; border-left: 2px solid rgba(255,255,255,0.18); }
.pride-bar__msg { font-size: 1rem; line-height: 1.5; margin-bottom: 12px; }
.pride-bar__progress {
  height: 10px;
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  overflow: hidden;
}
.pride-bar__fill {
  height: 100%;
  background: #FFD66E;
  border-radius: 999px;
  transition: width 1s cubic-bezier(.4,0,.2,1);
}
.pride-bar--low .pride-bar__fill { background: #F4D5C9; }
.pride-bar--mixed .pride-bar__fill { background: #F4A261; }
.pride-bar--good .pride-bar__fill { background: #4FC3B8; }
.pride-bar--excellent .pride-bar__fill { background: #FFD66E; }

@media (max-width: 720px) {
  .pride-bar { grid-template-columns: 1fr; gap: 14px; }
  .pride-bar__right { padding-left: 0; border-left: none; border-top: 2px solid rgba(255,255,255,0.18); padding-top: 14px; }
  .pride-bar__num { font-size: 2.8rem; }
}

.end-gauges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.end-gauge {
  background: var(--phare-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--line);
}
.end-gauge__label {
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  font-weight: 600;
}
.end-gauge__value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--phare-deep);
  font-weight: 700;
}
.end-gauge .gauge__bar { margin-top: 8px; }

/* Debrief */
.debrief-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 24px 0 8px;
}
.debrief-block {
  background: var(--phare-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px 24px;
}
.debrief-block h4 { color: var(--phare-deep); margin-bottom: 8px; }
.debrief-block p { color: var(--ink); margin: 0 0 8px; }
.debrief-block ul { padding-left: 18px; margin: 6px 0; }
.debrief-block li { margin: 4px 0; color: var(--ink); }
.debrief-block--help {
  grid-column: 1 / -1;
  background: var(--phare-deep);
  color: #E8FFFB;
  border-color: var(--phare-deep);
}
.debrief-block--help h4 { color: white; }
.help-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.help-pill {
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 220px;
}
.help-pill__num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--phare);
  padding: 2px 12px;
  border-radius: 6px;
}

#debrief-summary { margin: 8px 0; }
.summary-item {
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 8px 0;
  border-left: 3px solid var(--phare);
  font-size: 0.93rem;
}
.summary-item__turn {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--phare);
  letter-spacing: 0.1em;
  margin-bottom: 2px;
}

/* Teacher */
.teacher-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 24px;
}
.t-block {
  background: var(--phare-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px 24px;
}
.t-block--wide { grid-column: 1 / -1; }
.t-block h4 { color: var(--phare-deep); margin-bottom: 8px; }
.t-block p, .t-block li { color: var(--ink); }
.t-block ul { padding-left: 18px; margin: 6px 0; }
.t-block li { margin: 5px 0; }
.t-messages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.t-message {
  background: var(--paper);
  border-left: 3px solid var(--phare);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}

/* ===== Mode Classe (vote, gros caractères, bannière) ===== */
.classmode-banner {
  background: var(--gold);
  color: var(--phare-deep);
  border-radius: var(--radius-md);
  padding: 14px 22px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 14px -6px rgba(201,161,74,0.55);
}
.classmode-banner__pill {
  background: var(--phare-deep);
  color: white;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.classmode-banner__text { flex: 1; font-size: 0.96rem; line-height: 1.45; }
.classmode-banner__close {
  background: rgba(15,76,74,0.12);
  border: none;
  color: var(--phare-deep);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  font-weight: 700;
  transition: background .15s;
}
.classmode-banner__close:hover { background: rgba(15,76,74,0.25); }

/* ===== Atelier 50 min — bannière persistante en haut ===== */
.atelier-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--phare-deep);
  color: white;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 18px -6px rgba(0,0,0,0.25);
  margin: -24px -24px 18px;
  animation: fadeUp .35s;
  flex-wrap: wrap;
}
body.has-atelier #app { padding-top: 0; }
.atelier-banner__pill {
  background: var(--gold);
  color: var(--phare-deep);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
  text-transform: uppercase;
}
.atelier-banner__phases {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.atelier-phase {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  font-size: 0.82rem;
  opacity: 0.6;
  transition: all .25s;
}
.atelier-phase.is-active {
  background: var(--gold);
  color: var(--phare-deep);
  opacity: 1;
  font-weight: 600;
}
.atelier-phase.is-done { opacity: 0.4; }
.atelier-phase.is-done .atelier-phase__dot { background: var(--phare-soft); }
.atelier-phase__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
}
.atelier-phase.is-active .atelier-phase__dot { background: var(--phare-deep); }
.atelier-phase__dur {
  font-size: 0.7rem;
  opacity: 0.7;
}
.atelier-banner__timer {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-display);
}
.atelier-banner__current {
  font-size: 0.82rem;
  font-weight: 600;
  margin-right: 8px;
  opacity: 0.85;
}
.atelier-banner__time {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.atelier-banner__suggest {
  font-size: 0.85rem;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}
.atelier-banner.is-overtime .atelier-banner__time { color: #FFC857; animation: pulseTimer 1.4s infinite; }
@keyframes pulseTimer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.atelier-banner__next, .atelier-banner__close {
  background: rgba(255,255,255,0.12);
  border: none;
  color: white;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.85rem;
  transition: background .15s;
}
.atelier-banner__close {
  padding: 4px 10px;
  font-size: 1.05rem;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.atelier-banner__next:hover, .atelier-banner__close:hover { background: rgba(255,255,255,0.22); }

@media (max-width: 720px) {
  .atelier-banner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .atelier-banner__phases { width: 100%; }
}

/* Choix avec compteurs de votes */
.choice-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: stretch;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: all .2s;
}
.choice-row.is-winner {
  border-color: var(--phare);
  background: var(--phare-pale);
  box-shadow: 0 4px 14px -6px rgba(0,169,157,0.4);
}
.choice-row.is-locked .vote-btn { pointer-events: none; opacity: 0.5; }
.choice-row__letter {
  width: 36px; height: 36px;
  background: var(--phare-pale);
  color: var(--phare-deep);
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  align-self: center;
  font-size: 1.1rem;
}
.choice-row.is-winner .choice-row__letter { background: var(--phare); color: white; }
.choice-row__label {
  align-self: center;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
  padding: 4px 0;
}
.vote-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--phare-bg);
  border-radius: 999px;
  padding: 4px;
  align-self: center;
}
.vote-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--paper);
  color: var(--phare-deep);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-display);
  transition: all .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.vote-btn:hover { background: var(--phare-deep); color: white; }
.vote-count {
  min-width: 28px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--phare-deep);
  font-size: 1.05rem;
}
.vote-reveal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 14px 18px;
  background: var(--phare-bg);
  border-radius: var(--radius-md);
  border: 1px dashed var(--phare-soft);
}
.vote-reveal-row__info {
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.vote-reveal-row__info strong { color: var(--phare-deep); }

/* Panneau de discussion guidée (mode classe) */
.discussion-panel {
  background: linear-gradient(135deg, var(--phare-deep) 0%, #143A38 100%);
  color: #E8FFFB;
  border-radius: var(--radius-md);
  padding: 22px 26px;
  margin-top: 14px;
  box-shadow: 0 6px 20px -8px rgba(15,76,74,0.4);
  animation: fadeUp .45s ease-out;
}
.discussion-panel__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.discussion-panel__pill {
  background: var(--gold);
  color: var(--phare-deep);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
  text-transform: uppercase;
}
.discussion-panel__hint {
  font-size: 0.95rem;
  opacity: 0.85;
  font-style: italic;
}
.discussion-panel__list {
  counter-reset: q;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.discussion-panel__list li {
  counter-increment: q;
  padding: 14px 18px 14px 56px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--gold);
  position: relative;
  font-size: 1rem;
  line-height: 1.5;
}
.discussion-panel__list li::before {
  content: counter(q);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  background: var(--gold);
  color: var(--phare-deep);
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
}

body.is-class-mode .discussion-panel { padding: 28px 32px; }
body.is-class-mode .discussion-panel__list li { font-size: 1.12rem; padding: 16px 20px 16px 64px; }

/* Mode classe : agrandissement global pour projection */
body.is-class-mode .scene__narration { font-size: 1.2rem; line-height: 1.55; padding: 18px 22px; }
body.is-class-mode .scene__narration strong { font-size: 1.05em; }
body.is-class-mode .char__bubble { font-size: 1.1rem; max-width: 320px; padding: 14px 20px; }
body.is-class-mode .char__svg { width: 130px; height: 175px; }
body.is-class-mode .scene__stage { min-height: 280px; padding: 32px; }
body.is-class-mode .choice-row__label { font-size: 1.08rem; }
body.is-class-mode .board__loc-name { font-size: 2.1rem; }
body.is-class-mode .consequence__text { font-size: 1.15rem; line-height: 1.55; }
body.is-class-mode .consequence__edu { font-size: 1.02rem; }
body.is-class-mode .board { padding: 36px 40px; }
body.is-class-mode .map-tile { font-size: 0.88rem; padding: 12px 8px; }
body.is-class-mode .map-tile__icon { font-size: 1.4rem; }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .welcome-grid { grid-template-columns: 1fr; gap: 32px; }
  .game-layout { grid-template-columns: 1fr; }
  .rules-grid, .debrief-grid, .teacher-grid { grid-template-columns: 1fr; }
  .panel { padding: 28px 24px; }
  .hud { position: static; }
  .avatar-card { min-width: auto; grid-template-columns: 1fr; text-align: center; }
  .avatar-meta { text-align: center; }
  .title-display { font-size: clamp(2.4rem, 9vw, 4rem); }
}
@media (max-width: 560px) {
  #app { padding: 14px; }
  .panel { padding: 22px 18px; }
  h2 { font-size: 1.7rem; }
  .scene__chars { gap: 16px; }
  .char__svg { width: 76px; height: 100px; }
  .char__bubble { font-size: 0.88rem; }
  .map-tile { min-width: 70px; font-size: 0.72rem; }
  .brand-bar { flex-direction: column; gap: 10px; align-items: stretch; }
  .logo-slot { width: 100%; }
}

/* Focus states */
button:focus-visible {
  outline: 3px solid var(--phare-soft);
  outline-offset: 3px;
}

/* ===== FICHE IMPRIMABLE ===== */
.print-sheet { display: none; }

@media print {
  /* Reset général : on cache tout sauf la fiche */
  body { background: white !important; color: black !important; }
  body * { visibility: hidden; }
  .print-sheet, .print-sheet * { visibility: visible; }
  .print-sheet {
    display: block !important;
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    padding: 16mm 14mm;
    background: white;
    color: #1a1a1a;
    font-family: 'Lexend', system-ui, sans-serif;
    font-size: 10.5pt;
    line-height: 1.4;
  }
  @page { size: A4; margin: 0; }

  .ps-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #0F4C4A;
    padding-bottom: 8mm;
    margin-bottom: 6mm;
  }
  .ps-head__brand { font-family: 'Fraunces', serif; font-weight: 700; color: #0F4C4A; }
  .ps-head__brand h1 { font-size: 18pt; margin: 0 0 2mm; }
  .ps-head__brand .ps-sub { font-size: 9pt; font-weight: 400; color: #4A5E5C; font-family: 'Lexend', sans-serif; }
  .ps-head__meta { font-size: 9pt; text-align: right; color: #4A5E5C; }
  .ps-head__meta strong { color: #0F4C4A; }

  .ps-section { margin-bottom: 5mm; page-break-inside: avoid; }
  .ps-section h2 {
    font-family: 'Fraunces', serif;
    font-size: 12pt;
    color: #0F4C4A;
    margin: 0 0 2mm;
    border-bottom: 1px solid #DDD;
    padding-bottom: 1mm;
  }
  .ps-section p, .ps-section li { font-size: 10pt; line-height: 1.4; margin: 1mm 0; }

  .ps-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4mm;
    margin-bottom: 4mm;
  }
  .ps-info-box {
    border: 1px solid #DDD;
    border-left: 3px solid #00A99D;
    padding: 3mm 4mm;
    border-radius: 2mm;
  }
  .ps-info-box__label { font-size: 8pt; color: #4A5E5C; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1mm; }
  .ps-info-box__value { font-family: 'Fraunces', serif; font-weight: 700; color: #0F4C4A; font-size: 12pt; }

  .ps-gauges {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3mm;
  }
  .ps-gauge {
    border: 1px solid #DDD;
    padding: 2mm 3mm;
    border-radius: 2mm;
  }
  .ps-gauge__label { font-size: 8pt; color: #4A5E5C; }
  .ps-gauge__bar {
    height: 3mm;
    background: #EEE;
    border-radius: 1mm;
    overflow: hidden;
    margin-top: 1mm;
  }
  .ps-gauge__fill { height: 100%; background: #00A99D; }
  .ps-gauge--neg .ps-gauge__fill { background: #E07A5F; }
  .ps-gauge__value { font-family: 'Fraunces', serif; font-weight: 700; color: #0F4C4A; font-size: 11pt; }

  /* Score pédagogique (print) */
  .ps-pride {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6mm;
    align-items: center;
    background: #F4FAF9;
    border: 1px solid #00A99D;
    border-radius: 2mm;
    padding: 4mm 6mm;
  }
  .ps-pride__num {
    font-family: 'Fraunces', serif;
    font-weight: 900;
    color: #00A99D;
    font-size: 28pt;
    line-height: 1;
  }
  .ps-pride__num span { font-size: 14pt; opacity: 0.6; }
  .ps-pride__label { font-family: 'Fraunces', serif; font-weight: 700; color: #0F4C4A; font-size: 13pt; margin-bottom: 1mm; }
  .ps-pride__msg { font-size: 9.5pt; line-height: 1.4; color: #1a1a1a; }

  /* Badges débloqués (print) */
  .ps-badges {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3mm;
  }
  .ps-badge {
    display: grid;
    grid-template-columns: 10mm 1fr;
    gap: 3mm;
    align-items: start;
    background: #FFF8E5;
    border: 1px solid #C9A14A;
    border-radius: 2mm;
    padding: 3mm 4mm;
  }
  .ps-badge__icon {
    width: 9mm; height: 9mm;
    background: #C9A14A;
    color: white;
    border-radius: 2mm;
    display: flex; align-items: center; justify-content: center;
    font-size: 12pt;
  }
  .ps-badge__title { font-family: 'Fraunces', serif; font-weight: 700; color: #0F4C4A; font-size: 10pt; margin-bottom: 1mm; }
  .ps-badge__desc { font-size: 8.5pt; color: #4A5E5C; line-height: 1.35; }

  .ps-history { border-collapse: collapse; width: 100%; }
  .ps-history th, .ps-history td {
    text-align: left;
    padding: 2mm 3mm;
    border-bottom: 1px solid #EEE;
    font-size: 9.5pt;
    vertical-align: top;
  }
  .ps-history th { background: #F4FAF9; font-weight: 600; color: #0F4C4A; font-size: 8.5pt; text-transform: uppercase; letter-spacing: 0.05em; }
  .ps-history td.ps-turn { font-family: 'Fraunces', serif; font-weight: 700; color: #00A99D; width: 12mm; }
  .ps-history td.ps-loc { width: 22mm; color: #4A5E5C; }

  .ps-help {
    display: flex;
    gap: 4mm;
    background: #F4FAF9;
    border: 1px solid #00A99D;
    border-radius: 2mm;
    padding: 3mm 4mm;
    margin-top: 4mm;
  }
  .ps-help__num {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    color: white;
    background: #00A99D;
    padding: 1mm 3mm;
    border-radius: 1mm;
    font-size: 12pt;
    min-width: 18mm;
    text-align: center;
  }
  .ps-help__text { font-size: 9.5pt; padding-top: 1mm; }

  .ps-prolong { display: grid; gap: 2mm; }
  .ps-prolong li { padding: 2mm 3mm 2mm 5mm; border-left: 2px solid #00A99D; background: #F4FAF9; border-radius: 0 2mm 2mm 0; list-style: none; }

  .ps-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8mm;
    margin-top: 8mm;
  }
  .ps-sign { border-top: 1px solid #888; padding-top: 2mm; font-size: 8pt; color: #4A5E5C; }

  .ps-foot {
    border-top: 1px solid #DDD;
    padding-top: 3mm;
    margin-top: 6mm;
    font-size: 8pt;
    color: #4A5E5C;
    display: flex;
    justify-content: space-between;
  }
}

/* =======================================================================
   RESPONSIVE MOBILE — confort tactile téléphone (ajouté pour la version PWA)
   ======================================================================= */
@media (max-width: 640px) {
  html { -webkit-text-size-adjust: 100%; }
  #app { padding: 12px; }
  .panel { padding: 20px 16px; }

  /* Boutons d'action : pleine largeur, cible tactile confortable */
  .cta-row { gap: 10px; }
  .cta-row .btn { flex: 1 1 100%; width: 100%; justify-content: center; min-height: 48px; }
  .cta-row--end, .cta-row--center { justify-content: stretch; }

  .title-display { font-size: clamp(2.1rem, 11vw, 3.2rem); line-height: 1.02; }
  .lede { font-size: 1rem; }

  /* En-tête logos */
  .brand-bar { flex-direction: row; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
  .logo-slot { width: auto; }

  /* HUD de partie : passe au-dessus du plateau, gauges plus compactes */
  .game-layout { gap: 16px; }
  .hud { position: static; padding: 16px 14px; }
  .board { padding: 16px 14px; }

  /* Bannières atelier / mode classe : empilées */
  .atelier-banner, .classmode-banner { flex-direction: column; align-items: stretch; gap: 8px; text-align: left; }
  .atelier-banner__phases { flex-wrap: wrap; }

  /* Cartes de choix en jeu : pleine largeur, bien cliquables */
  .choice { width: 100%; min-height: 48px; }
  .choice-row { flex-wrap: wrap; }
  .choice-row__label { font-size: 0.98rem; }

  /* Scène / personnages */
  .scene { min-height: auto; }
  .scene__chars { flex-wrap: wrap; justify-content: center; }

  /* Grilles diverses → 1 colonne */
  .rules-grid, .debrief-grid, .teacher-grid, .badges-grid, .badges-grid--catalog { grid-template-columns: 1fr; }

  /* Tableaux de stats enseignant */
  #sessions-stats .ss-grid { grid-template-columns: 1fr; }
  #sessions-stats .ss-kpis { flex-direction: column; }
}

@media (max-width: 420px) {
  h2 { font-size: 1.55rem; }
  .title-display { font-size: clamp(1.9rem, 12vw, 2.6rem); }
  .btn { font-size: 0.95rem; padding-left: 14px; padding-right: 14px; }
  .map-tile { min-width: 60px; font-size: 0.68rem; }
}


/* ============================================================
   ANIMATIONS DE MISE EN SCÈNE — « dessin animé » léger
   Entrées en scène, bulles, humeurs, transitions, intro accueil.
============================================================ */
@keyframes charEnterL { from { opacity: 0; transform: translateX(-42px); } to { opacity: 1; transform: none; } }
@keyframes charEnterR { from { opacity: 0; transform: translateX(42px); } to { opacity: 1; transform: none; } }
@keyframes bubblePop { 0% { opacity: 0; transform: scale(.55) translateY(8px); } 70% { transform: scale(1.07); } 100% { opacity: 1; transform: none; } }
@keyframes bobIdle { from { transform: translateY(0); } to { transform: translateY(-4px); } }
@keyframes bounceHappy { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-6px) rotate(-2deg); } 60% { transform: translateY(-1px) rotate(2deg); } }
@keyframes shakeAngry { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-2px) rotate(-1.5deg); } 40% { transform: translateX(2px) rotate(1.5deg); } 60% { transform: translateX(-2px); } 80% { transform: translateX(2px); } }
@keyframes droopSad { from { transform: translateY(0) rotate(0); } to { transform: translateY(3px) rotate(-2deg); } }
@keyframes trembleWorried { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-1px, 1px); } 50% { transform: translate(1px, -1px); } 75% { transform: translate(-1px, -1px); } }
@keyframes fadeUpSoft { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pulseTile { 0%, 100% { box-shadow: 0 0 0 0 rgba(0, 169, 157, .35); } 50% { box-shadow: 0 0 0 8px rgba(0, 169, 157, 0); } }

/* Entrées en scène */
.scene__chars .char--left  { animation: charEnterL .55s ease-out both; }
.scene__chars .char--right { animation: charEnterR .55s ease-out both; }
.scene__chars .char:nth-child(2) { animation-delay: .15s; }
.scene__chars .char:nth-child(3) { animation-delay: .3s; }

/* Bulles */
.char__bubble { animation: bubblePop .4s ease-out both; animation-delay: .55s; transform-origin: bottom center; }
.char:nth-child(2) .char__bubble { animation-delay: .78s; }
.char:nth-child(3) .char__bubble { animation-delay: 1s; }

/* Vie des personnages selon l'humeur */
.char__svg { animation: bobIdle 2.6s ease-in-out infinite alternate; }
.char:nth-child(2) .char__svg { animation-duration: 3.1s; }
.char--mood-happy .char__svg { animation: bounceHappy 1.9s ease-in-out infinite; }
.char--mood-angry .char__svg { animation: shakeAngry 1.2s ease-in-out infinite; }
.char--mood-sad .char__svg,
.char--mood-cry .char__svg { animation: droopSad 2.4s ease-in-out infinite alternate; }
.char--mood-worried .char__svg { animation: trembleWorried 1.6s ease-in-out infinite; }

/* Narration, choix, conséquence */
.scene__narration { animation: fadeUpSoft .5s ease-out both; animation-delay: .35s; }
.choices .choice, .choices .choice-row { animation: fadeUpSoft .45s ease-out both; }
.choices .choice:nth-child(1), .choices .choice-row:nth-child(1) { animation-delay: .65s; }
.choices .choice:nth-child(2), .choices .choice-row:nth-child(2) { animation-delay: .8s; }
.choices .choice:nth-child(3), .choices .choice-row:nth-child(3) { animation-delay: .95s; }
.choices .choice:nth-child(4), .choices .choice-row:nth-child(4) { animation-delay: 1.1s; }
.consequence { animation: fadeUpSoft .5s ease-out both; }
.discussion-panel { animation: fadeUpSoft .5s ease-out both; }

/* Vue duale et plateau */
.dual-side--left  { animation: charEnterL .6s ease-out both; }
.dual-side--right { animation: charEnterR .6s ease-out both; }
.map-tile.is-active { animation: pulseTile 2s infinite; }

/* Intro animée de l'accueil */
.intro-card h3 { margin-bottom: 6px; }
.intro-stage { display: flex; justify-content: center; align-items: flex-end; gap: 12px; min-height: 130px; padding-top: 26px; }
.intro-stage .ichar { width: 72px; position: relative; animation: fadeUpSoft .5s ease-out both; }
.intro-stage .ichar__svg svg { width: 100%; height: auto; display: block; }
.intro-stage .ichar__svg--sad,
.intro-stage .ichar__svg--cry { animation: droopSad 2.4s ease-in-out infinite alternate; }
.intro-stage .ichar__svg--happy { animation: bounceHappy 1.9s ease-in-out infinite; }
.intro-stage .ichar__svg--worried { animation: trembleWorried 1.6s ease-in-out infinite; }
.intro-stage .ichar__svg--neutral { animation: bobIdle 2.6s ease-in-out infinite alternate; }
.ichar__bubble { position: absolute; top: -24px; left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 2px 9px; font-size: .72rem; white-space: nowrap; box-shadow: var(--shadow-soft); animation: bubblePop .4s ease-out both; z-index: 2; }
.intro-caption { text-align: center; font-size: .86rem; color: var(--ink-soft); min-height: 2.4em; margin: 10px 0 0; transition: opacity .3s; }

/* Accessibilité : réduire les animations si demandé */
@media (prefers-reduced-motion: reduce) {
  .scene__chars .char, .char__bubble, .char__svg,
  .scene__narration, .choices .choice, .choices .choice-row,
  .consequence, .discussion-panel, .dual-side--left, .dual-side--right,
  .map-tile.is-active, .intro-stage .ichar, .intro-stage [class*="ichar__svg--"], .ichar__bubble {
    animation: none !important;
  }
}
