/* =========================================================
   CV QUEST v2-exp — écran fixe : plateau entier visible,
   timeline en panneau latéral à défilement interne
   ========================================================= */

:root {
  --bg: #050507;          /* noir extra sombre */
  --night: #050507;
  --frame: #1a2a26;
  --ink: #f2f2f2;
  --accent: #e8c14a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ---------- Bandeau d'erreur (diagnostic) ---------- */
#err-banner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: #b3261e;
  color: #fff;
  font-family: monospace;
  font-size: 11px;
  padding: 8px 12px;
  white-space: normal;
  max-height: 45vh;
  overflow-y: auto;
  word-break: break-all;
}

html, body {
  height: 100%;
  overflow: hidden;          /* écran fixe : aucun scroll de page */
}

/* ---------- Écrans (2 vues basculables) ---------- */
.screen {
  position: relative;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.screen.hidden { display: none; }

body {
  height: 100dvh;            /* suit la barre d'adresse mobile */
  background: var(--bg);
  color: var(--ink);
  font-family: 'Press Start 2P', 'Courier New', monospace;
  display: flex;
  flex-direction: column;
}

/* ---------- Header & footer en surimpression (pleine page) ---------- */
.hero {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  text-align: center;
  padding: 12px 12px 22px;
  background: linear-gradient(#0e0e1ae6, #0e0e1a00);
  pointer-events: none;
}

.board-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: linear-gradient(#0e0e1a00, #0e0e1ae6);
}

.hero h1 { pointer-events: auto; }

h1 {
  font-size: 16px;
  color: var(--accent);
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 #7a4a12;
}

.subtitle { margin-top: 5px; font-size: 7px; color: #9a94b8; }

/* ---------- Écran plateau : pleine page ---------- */
.game-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  height: 100%;
}

/* colonne centrale : masquée sur mobile (les dés y sont relogés en web) */
#center-col { display: none; }

/* boutons mobiles uniquement (site en haut à droite + rejouer dans le HUD) */
.site-top-btn,
.btn-replay-mob { display: none; }

/* ---------- Plateau : toujours entièrement visible ---------- */
.board-col {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Carte 3D : perspective + inclinaison souris ---------- */
.board-scene {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  perspective: 1400px;
  perspective-origin: 50% 50%;
}

.board-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#board-img {
  display: block;
  max-width: 100vw;          /* pleine page sur web comme mobile */
  max-height: 100dvh;
  width: auto;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#char-layer {
  position: absolute;        /* positionné/taillé par syncCanvas() */
  image-rendering: pixelated;
  pointer-events: auto;      /* blocs "?" cliquables */
}

/* reflet lumineux qui suit la souris (pos/size calés sur l'image en JS) */
.board-glare {
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: .85;
  z-index: 3;
}

/* halo néon derrière la carte (liseré qui dépasse les bords) */
.board-glow {
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  pointer-events: none;
  z-index: -1;
  border-radius: 18px;
  box-shadow:
    0 0 42px 8px rgba(124, 140, 255, .35),
    0 0 90px 22px rgba(232, 193, 74, .18);
}

/* ombre au sol : plate, immobile sous la carte */
.board-shadow {
  position: absolute;
  left: 0; top: 0;
  width: 0; height: 0;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(50% 50% at 50% 50%, rgba(0,0,0,.6), rgba(0,0,0,0) 72%);
  filter: blur(10px);
}

/* entrée en scène de la carte (elle surgit, se redresse) */
.board-scene.board-enter {
  animation: board-in 1.5s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes board-in {
  0%   { opacity: 0; transform: translateY(48px) scale(.9) rotate(3deg); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

/* ---------- Pied de page du plateau : légende + bascule ---------- */
.board-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 16px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 6px;
  color: #b8b2dd;
}

.legend-swatch {
  width: 12px;
  height: 7px;
  border: 2px solid var(--frame);
  transform: skewX(-30deg) scaleY(.9);
}

/* ---------- Écran timeline : plein écran ---------- */
#screen-timeline {
  background:
    radial-gradient(1200px 640px at 88% -8%, rgba(41, 182, 246, .10), transparent 60%),
    radial-gradient(900px 520px at -6% 108%, rgba(232, 193, 74, .10), transparent 60%),
    radial-gradient(#ffffff08 1px, transparent 1.3px) 0 0 / 32px 32px,
    var(--night);
}

.timeline-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 3px solid var(--frame);
}

.tl-title {
  font-size: 12px;
  color: #b8b2dd;
}

.timeline-header .pixel-btn { flex: 0 0 auto; }

/* ---------- Invite "Scrolle vers le bas !" ---------- */
#screen-timeline { position: relative; }

.scroll-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  pointer-events: none;
  opacity: 1;
  transition: opacity .9s ease, transform .9s ease;
}

.scroll-hint.hidden {
  opacity: 0;
  transform: translate(-50%, -58%);
}

.hint-text {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(12px, 2.2vw, 22px);
  color: #ffffff;
  text-align: center;
  line-height: 1.6;
  text-shadow:
    0 0 14px #ffffffaa,
    3px 3px 0 #1a2a26,
    0 0 40px #4ad9ff66;
  animation: hint-pulse 1.6s ease-in-out infinite;
}

.hint-arrow {
  font-size: clamp(16px, 2.6vw, 26px);
  color: var(--accent);
  text-shadow: 0 0 12px #e8c14aa0, 2px 2px 0 #1a2a26;
  animation: hint-bounce 1s steps(2) infinite;
}

@keyframes hint-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .75; }
}

@keyframes hint-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(8px); }
}

/* pulsation partagée web & mobile (invite "Lancez les dés !") */
@keyframes dice-hint-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .7; }
}

.tl-scroll {
  position: relative;        /* référentiel du SVG et des étiquettes */
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.tl-scroll::-webkit-scrollbar { width: 8px; }
.tl-scroll::-webkit-scrollbar-track { background: #0b0b10; }
.tl-scroll::-webkit-scrollbar-thumb { background: #2e2e44; border: 2px solid #0b0b10; }

#tl-svg {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
}

/* WEB : ligne fantôme grise = structure de la frise, visible en entier */
.tl-ghost {
  fill: none;
  stroke: #ffffff24;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tl-line {
  fill: none;
  stroke: url(#tlgrad);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 7px rgba(124, 180, 255, .55));
}

/* 3 états : invisible → "pre" (cercle pâle annoncé avant le passage
   de la ligne) → "on" (illuminé au passage, texte révélé) */
.tl-dot {
  fill: var(--night);
  stroke: #ffffff;
  stroke-width: 3;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity .4s ease, filter .4s ease;
}

.tl-dot.pre {
  opacity: .4;
}

.tl-dot.on {
  opacity: 1;
  stroke: #ffffff;
  animation: dot-pulse 2.6s ease-in-out infinite;
}

.tl-dot.dot-start.on     { fill: #f2f2f2; filter: drop-shadow(0 0 10px #f2f2f2cc); }
.tl-dot.dot-formation.on { fill: #3aa8e8; filter: drop-shadow(0 0 11px #3aa8e8cc); }
.tl-dot.dot-emploi.on    { fill: #4cc24c; filter: drop-shadow(0 0 11px #4cc24ccc); }
.tl-dot.dot-freelance.on { fill: #f2a03c; filter: drop-shadow(0 0 11px #f2a03ccc); }
.tl-dot.dot-end.on       { fill: #e85858; filter: drop-shadow(0 0 13px #e85858dd); }

@keyframes dot-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.22); }
}

.tl-label {
  position: absolute;
  width: min(44%, 400px);
  font-family: 'Patrick Hand', 'Segoe Print', 'Comic Sans MS', cursive;
  color: #f5f2e8;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .55s cubic-bezier(.2, .7, .2, 1), transform .55s cubic-bezier(.2, .7, .2, 1);
  background: linear-gradient(160deg, rgba(35, 38, 60, .9), rgba(15, 16, 30, .88));
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 16px;
  padding: 14px 16px 13px;
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .02);
}
.tl-label.on { opacity: 1; transform: translateY(0); }

.tl-label:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, .6), 0 0 0 1px var(--c, #ffffff22) inset;
}

/* couleur d'accent par type (pastille, trait, année, icône) */
.tl-label.type-start     { --c: #f2f2f2; }
.tl-label.type-formation { --c: #3aa8e8; }
.tl-label.type-emploi    { --c: #4cc24c; }
.tl-label.type-freelance { --c: #f2a03c; }
.tl-label.type-end       { --c: #e85858; }

.tl-label.side-left  { left: 3%;  text-align: right; }
.tl-label.side-right { right: 3%; text-align: left; }

/* barre d'accent lumineuse tournée vers la ligne */
.tl-label::before {
  content: '';
  position: absolute;
  top: 18px; bottom: 18px;
  width: 4px;
  border-radius: 3px;
  background: linear-gradient(var(--c, #ffffff), rgba(255, 255, 255, .02));
  box-shadow: 0 0 12px var(--c, #ffffff);
}
.tl-label.side-left::before  { right: -2px; }
.tl-label.side-right::before { left: -2px; }

/* pastille icône (type d'expérience) */
.tl-label .tl-icon {
  position: absolute;
  top: -14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  border-radius: 50%;
  background: #171a2c;
  border: 2px solid var(--c, #ffffff);
  box-shadow: 0 0 14px var(--c, #ffffff55), inset 0 0 6px rgba(255, 255, 255, .08);
}
.tl-label.side-left .tl-icon  { right: 15px; }
.tl-label.side-right .tl-icon { left: 15px; }

.tl-label .year {
  display: block;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--c, var(--accent));
  margin-bottom: 5px;
  text-shadow: 0 0 12px var(--c, #0000);
}

.tl-label .periode {
  font-family: 'Patrick Hand', cursive;
  font-size: 13px;
  color: #9a94b8;
}

.tl-label .titre  { display: block; font-size: 19px; line-height: 1.15; font-weight: 700; }
.tl-label .lieu   { display: block; font-size: 13px; color: #b8b2dd; margin-top: 3px; }

/* STRATEMIND (texte simple) : gras, blanc + cyan vif, style logo */
.brand-plain {
  display: inline-block;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 900;
  font-size: 19px;
  letter-spacing: 1.5px;
  color: #ffffff;
  line-height: 1.2;
  margin-top: 2px;
}

.brand-plain .brand-b { color: #29b6f6; }

/* ---------- Lien logo cliquable (style STRATEMIND) ---------- */
.brand-link {
  display: inline-block;
  margin-top: 6px;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 2px;
  color: #ffffff;
  text-decoration: none;
  background: #0b1524;
  padding: 9px 16px;
  border-radius: 6px;
  box-shadow: 0 0 14px #29b6f655, inset 0 0 0 1px #29b6f633;
  transition: box-shadow .25s ease, transform .25s ease;
}

.brand-b { color: #29b6f6; }

.brand-ext {
  font-size: 13px;
  font-weight: 700;
  color: #29b6f6;
  margin-left: 8px;
  vertical-align: 2px;
}

.brand-link:hover,
.brand-link:focus-visible {
  cursor: pointer;
  box-shadow: 0 0 22px #29b6f6aa, inset 0 0 0 1px #29b6f688;
  transform: translateY(-2px);
}

.tl-label .points { margin-top: 6px; padding: 0; list-style: none; }

.tl-label .points li {
  position: relative;
  font-size: 13px;
  line-height: 1.3;
  color: #d8d4ee;
  padding-left: 13px;
  margin-bottom: 3px;
}

.tl-label .points li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ---------- Boutons de fin (dans la timeline, après la dernière case) ---------- */
.end-inside {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  padding: 0 16px;
}

.end-text {
  font-family: 'Patrick Hand', cursive;
  font-size: 19px;
  color: #9a94b8;
  margin-bottom: 14px;
}

.end-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  transition: transform .3s ease;
}

.glow { animation: glow .9s ease infinite alternate; }
@keyframes glow {
  from { transform: scale(1);    filter: drop-shadow(0 0 0 #e8c14a00); }
  to   { transform: scale(1.05); filter: drop-shadow(0 0 10px #e8c14aa0); }
}

.link-replay {
  margin-top: 16px;
  font-family: inherit;
  font-size: 7px;
  background: none;
  border: none;
  color: #8a84b0;
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- Boutons pixel ---------- */
.pixel-btn {
  font-family: inherit;
  font-size: 8px;
  color: #1a2a26;
  background: var(--accent);
  border: 3px solid var(--frame);
  box-shadow: inset -3px -3px 0 #00000033, 4px 4px 0 #00000088;
  padding: 12px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
.pixel-btn:active { transform: translate(2px, 2px); }
.pixel-btn-alt { background: #d8d5c8; }

/* ---------- HUD dés (fixe) ---------- */
.pixel-panel {
  background: #22223a;
  border: 4px solid var(--frame);
  box-shadow: inset 3px 3px 0 #ffffff14, inset -3px -3px 0 #00000040, 6px 6px 0 #00000066;
}

.dice-hud {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 50;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.dice-row { display: flex; gap: 9px; }

.dice {
  width: 50px;
  height: 50px;
  background: #f5f2e8;
  border: 4px solid var(--frame);
  box-shadow: inset -5px -5px 0 #00000022, 4px 4px 0 #000000aa;
  cursor: pointer;
  padding: 6px;
  transition: transform .1s steps(2);
}
.dice:hover { transform: translateY(-3px); }
.dice:disabled { cursor: default; opacity: .8; }

.dice.rolling { animation: tumble .12s linear infinite alternate; }
@keyframes tumble {
  from { transform: rotate(-13deg) translateY(0); }
  to   { transform: rotate(13deg) translateY(-7px); }
}

.pip-grid {
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  width: 100%;
  height: 100%;
}

.pip {
  width: 7px;
  height: 7px;
  background: var(--frame);
  border-radius: 2px;
  place-self: center;
}

.hud-total { font-size: 10px; color: var(--accent); }
.dice-msg  { font-size: 6px; color: #b8b2dd; text-align: center; line-height: 1.7; }
.hud-progress { font-size: 6px; color: #8a84b0; }

/* ---------- Info-bulle bonus (blocs "?") ---------- */
.bonus-card {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: 250px;
  background: #22223a;
  border: 3px solid #1a2a26;
  box-shadow: inset 2px 2px 0 #ffffff14, 5px 5px 0 #00000088;
  padding: 10px 12px;
  z-index: 20;
  pointer-events: none;
  text-align: left;
  animation: bonus-pop .25s steps(3) both;
}

.bonus-card > div { min-width: 0; overflow: hidden; }

@keyframes bonus-pop {
  from { transform: translate(-50%, -100%) scale(.3); opacity: 0; }
  to   { transform: translate(-50%, -100%) scale(1);  opacity: 1; }
}

.bonus-card.below {
  transform: translate(-50%, 0);
  animation-name: bonus-pop-below;
}

@keyframes bonus-pop-below {
  from { transform: translate(-50%, 0) scale(.3); opacity: 0; }
  to   { transform: translate(-50%, 0) scale(1);  opacity: 1; }
}

.bonus-icon { font-size: 22px; }

.bonus-titre {
  display: block;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--accent);
  margin-bottom: 4px;
}

.bonus-texte {
  display: block;
  font-family: 'Patrick Hand', cursive;
  font-size: 15px;
  line-height: 1.25;
  color: #f5f2e8;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---------- Modales ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: #000000b3;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.overlay.hidden { display: none; }

.modal {
  background: #22223a;
  border: 4px solid var(--frame);
  box-shadow: 8px 8px 0 #00000088;
  padding: 26px;
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.modal h2 { font-size: 13px; margin-bottom: 16px; }

.modal form { display: flex; flex-direction: column; gap: 10px; text-align: left; }

.modal label {
  font-family: 'Patrick Hand', cursive;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal input, .modal textarea {
  font-family: 'Patrick Hand', cursive;
  font-size: 16px;
  border: 2px solid var(--frame);
  padding: 7px;
  background: #fff;
  color: #222;
  resize: vertical;
}

.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }

.success {
  font-family: 'Patrick Hand', cursive;
  font-size: 17px;
  color: #7de87d;
  margin-top: 10px;
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  h1 { font-size: 13px; }
  .tl-label .titre  { font-size: 16px; }
  .tl-label .lieu   { font-size: 12px; }
  .tl-label .points li { font-size: 12px; }
  .tl-label { width: min(46%, 260px); }

  /* la colonne centrale devient transparente : les dés flottent en fixe
     sur le plateau, les boutons du menu central sont masqués (ils vivent
     en fin de timeline sur mobile) */
  #center-col { display: contents; }
  .center-actions { display: none; }

  /* bouton "Revenir au site" en haut à droite (mobile) */
  .site-top-btn {
    display: inline-block;
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 20;
    font-family: 'Press Start 2P', monospace;
    font-size: 6px;
    color: #1a2a26;
    background: var(--accent);
    border: 3px solid var(--frame);
    box-shadow: inset -3px -3px 0 #00000033, 3px 3px 0 #00000088;
    padding: 8px 9px;
    text-decoration: none;
    line-height: 1.5;
  }

  /* bouton Rejouer sous le bloc des dés (mobile) */
  .btn-replay-mob {
    display: inline-block;
    width: 100%;
    margin-top: 8px;
  }

  /* sur l'écran timeline, les dés flottants gêneraient la lecture */
  body.timeline-mode .dice-hud { display: none; }

  /* =========================================================
     MENU CONTEXTUEL DU BAS — deux phases :
     Phase 1 : la barre du bas EST le menu dés (2 dés cliquables).
     Phase 2 : arrivée au volcan → la barre devient « Voir la timeline ».
     ========================================================= */

  /* ---- Phase 1 : barre des dés ---- */
  .dice-hud {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: auto;
    max-height: none;
    overflow: visible;
    padding: 9px 12px;
    background: #0a1020;
    border-top: 3px solid var(--frame);
    transform: none;
  }
  .dice-hud .dice-row { gap: 12px; }
  .dice-hud .dice { width: 11vw; height: 11vw; max-width: 46px; max-height: 46px; }
  .dice-hud #hud-total { font-size: 10px; min-height: 0; }
  .dice-hud .dice-msg {
    min-height: 0;
    flex: 1 1 auto;
    max-width: 44vw;
    text-align: left;
    font-size: 8px;
    line-height: 1.6;
  }
  .dice-hud #hud-progress { font-size: 9px; color: #8a84b0; }
  .dice-hud .btn-replay-mob { display: none; }   /* rejouer : via « Retour au plateau » */

  /* message brillant au-dessus de la barre — disparaît à l'activation */
  .dice-hint {
    display: block;
    position: fixed;
    left: 0; right: 0;
    bottom: 112px;
    top: auto;
    width: auto;
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    line-height: 1.9;
    color: #ffffff;
    text-align: center;
    pointer-events: none;
    opacity: 1;
    transition: opacity .8s ease;
    text-shadow:
      0 0 14px #e8c14acc,
      2px 2px 0 #1a2a26,
      0 0 36px #e8c14a66;
    animation: dice-hint-pulse 1.6s ease-in-out infinite;
  }

  .dice-hint.hidden {
    opacity: 0;
    animation: none;          /* stoppe la pulsation pour permettre le fondu */
  }

  .hero { padding: 8px 10px 18px; }
  #legend { display: none; }
  .board-footer { display: none; }   /* phase 1 : la barre des dés la remplace */

  /* ---- Phase 2 : arrivée au volcan → « Voir la timeline » ---- */
  body.cv-end .dice-hud { display: none; }
  body.cv-end .board-footer {
    display: block;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 40;
    padding: 0;
    background: #0a1020;
    border-top: 3px solid var(--frame);
  }
  body.cv-end #goto-timeline {
    display: block; width: 100%;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: #ffd60a;
    background: transparent;
    border: none;
    padding: 16px 10px;
    cursor: pointer;
    animation: footer-glow 1.6s ease-in-out infinite;
  }
  @keyframes footer-glow {
    0%, 100% { text-shadow: 0 0 8px #ffd60a88;
               box-shadow: 0 -4px 14px #ffd60a55; }
    50%      { text-shadow: 0 0 16px #ffd60ae6;
               box-shadow: 0 -8px 28px #ffd60acc; }
  }
  /* la carte garde de l'air au-dessus de la barre */
  .game-layout { padding-bottom: 58px; }

  .bonus-card { max-width: 190px; }
  .bonus-texte { font-size: 13px; }
  .bonus-icon { font-size: 18px; }

  .timeline-header { flex-direction: row; padding: 10px 12px; }
  .tl-title { font-size: 9px; }
}

/* =========================================================
   WEB : plateau À GAUCHE + timeline À DROITE sur la même page,
   boutons de bascule supprimés (les deux écrans coexistent)
   ========================================================= */
@media (min-width: 761px) {
  /* 3 colonnes harmonieuses : plateau | dés+boutons | timeline
     — l'ensemble est centré dans la page, la colonne plateau fait
     exactement la largeur de l'image (44,8% de sa hauteur) + marges */
  body {
    display: grid;
    grid-template-columns:
      calc(44.8dvh)
      190px
      clamp(340px, 28vw, 460px);
    column-gap: 24px;         /* écart IDENTIQUE entre les 3 encadrés */
    justify-content: center;
    align-content: center;
  }

  /* les deux écrans coexistent : le masquage .hidden est neutralisé */
  .screen,
  .screen.hidden {
    display: flex;
  }

  /* le plateau occupe exactement sa colonne : l'écart avec les
   colonnes voisines est contrôlé par le column-gap de la grille */
  .game-layout {
    padding: 0;
    position: relative;
  }

  /* ---------- Invite "Lancez les dés !" (brillante, au-dessus du panneau) ---------- */
  .dice-hint {
    width: 100%;
    margin-bottom: 14px;
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(10px, 1.1vw, 15px);
    color: #ffffff;
    text-align: center;
    pointer-events: none;
    opacity: 1;
    transition: opacity .8s ease;
    text-shadow:
      0 0 16px #e8c14acc,
      3px 3px 0 #1a2a26,
      0 0 44px #e8c14a66;
    animation: dice-hint-pulse 1.6s ease-in-out infinite;
  }

  .dice-hint.hidden {
    opacity: 0;
    animation: none;   /* stoppe la pulsation, sinon elle écrase le fondu */
  }

  .board-col {
    align-items: center;       /* plateau centré dans sa colonne */
  }

  .board-frame {
    margin: 0;
  }

  /* plus besoin de basculer : les boutons disparaissent */
  .board-footer .pixel-btn,
  .timeline-header .pixel-btn {
    display: none;
  }

  /* colonne centrale : dés + boutons, centrés verticalement */
  #center-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 12px 6px;
  }

  .dice-hud {
    position: static;        /* le HUD quitte le mode fixe et vit dans la colonne */
    transform: none;
    width: 100%;             /* même largeur que les boutons → encadrés alignés */
    max-width: 100%;
    box-sizing: border-box;
  }

  /* réserves de hauteur : la boîte ne se redimensionne plus entre les lancés */
  .dice-msg {
    min-height: 4.2em;
  }

  .hud-total {
    min-height: 1.4em;
  }

  .center-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;                 /* disposition régulière des boutons */
    width: 100%;
  }

  .center-actions .pixel-btn {
    width: 100%;
    box-sizing: border-box;
    font-size: 7px;
    padding: 11px 8px;
  }

  /* STRATEMIND : police du logo SUR un bouton jaune comme les autres */
  .center-actions .brand-btn {
    background: var(--accent);
    box-shadow: inset -3px -3px 0 #00000033, 4px 4px 0 #00000088;
    border-radius: 0;
    text-align: center;
    color: #1a2a26;          /* le texte simple ("Retour au ") reste lisible sur jaune */
    margin-top: 24px;        /* léger détachement en bas du groupe */
    /* mêmes dimensions et typographie que les pixel-btn */
    width: 100%;
    box-sizing: border-box;
    padding: 11px 8px;
    font-family: 'Press Start 2P', monospace;
    font-weight: normal;
    font-size: 7px;
    letter-spacing: 0;
  }

  .center-actions .brand-btn .brand-a,
  .center-actions .brand-btn .brand-b {
    font-size: inherit;
    letter-spacing: inherit;
  }

  .center-actions .brand-btn .brand-a { color: #1a2a26; }
  .center-actions .brand-btn .brand-b { color: #0e7fb8; }

  .center-actions .brand-link:hover,
  .center-actions .brand-btn:hover,
  .center-actions .brand-btn:focus-visible {
    box-shadow: inset -3px -3px 0 #00000033, 6px 6px 0 #00000088;
    transform: translateY(-1px);
  }

  .center-actions .brand-link:hover .brand-a,
  .center-actions .brand-btn:hover .brand-a { color: #1a2a26; }

  /* STRATEMIND dans la timeline : simple texte à la police du logo */
  .brand-plain {
    display: inline-block;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: 1.5px;
    color: #ffffff;
    line-height: 1.2;
    margin-top: 2px;
  }

  .brand-plain .brand-b { color: #29b6f6; }

  /* timeline : un seul écran, sans scroll, pastilles compactes */
  .tl-scroll {
    overflow: hidden;
  }

  .scroll-hint,
  .end-inside {
    display: none;
  }

  .tl-label {
    width: min(42%, 195px);
  }

  .tl-label .year    { font-size: 8px; margin-bottom: 2px; }
  .tl-label .periode { font-size: 11px; }
  .tl-label .titre   { font-size: 15px; line-height: 1.05; }
  .tl-label .lieu    { font-size: 11px; margin-top: 1px; }
  .tl-label .points  { display: none; }   /* les détails restent sur mobile */

  .brand-link {
    font-size: 15px;
    padding: 6px 10px;
    letter-spacing: 1px;
  }

  .brand-ext { font-size: 10px; margin-left: 5px; }

  #screen-timeline {
    border-left: 4px solid var(--frame);
    border-right: 4px solid var(--frame);   /* ferme le cartouche à droite */
    box-shadow: -10px 0 26px #00000066;
  }

  .timeline-header {
    justify-content: center;
    padding: 8px 12px;
  }

  .tl-title { font-size: 8px; }
}

/* ---------- Panneau « 7 » : recette du pudding à l'arsenic ---------- */
.recipe-modal {
  background: #efe6c8;
  border: 4px solid #6b4a2b;
  box-shadow: 8px 8px 0 #00000088;
  padding: 18px 18px 14px;
  max-width: 680px;
  width: 100%;
  max-height: 88dvh;
  overflow-y: auto;
  text-align: left;
}
.recipe-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #6b4a2b;
  text-align: center;
  margin-bottom: 5px;
}
.recipe-sub {
  font-family: 'Patrick Hand', cursive;
  font-size: 14px;
  color: #8a7a55;
  text-align: center;
  margin-bottom: 13px;
}
.recipe-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 10px;
}
.recipe-win {
  position: relative;
  background: #f6d76b;
  border: 3px solid #7a4a2e;
  box-shadow: inset 2px 2px 0 #ffffff55, inset -2px -2px 0 #00000022;
  padding: 9px 10px 9px;
}
.recipe-win.full { grid-column: 1 / -1; }
.recipe-win .num {
  position: absolute;
  top: -9px;
  left: -7px;
  background: #7a4a2e;
  color: #f6d76b;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  padding: 3px 5px;
  border: 2px solid #4c2f1c;
}
.recipe-win p {
  font-family: 'Patrick Hand', cursive;
  font-size: 14.5px;
  line-height: 1.3;
  color: #3a2c18;
}
.recipe-win .aside { font-style: italic; color: #7a6a4a; font-size: 13.5px; }
.recipe-win .cri {
  font-weight: bold;
  color: #a33327;
  display: block;
  margin-top: 2px;
}
.recipe-win .fin {
  font-style: italic;
  color: #55503c;
  display: block;
}
@media (max-width: 760px) {
  .recipe-grid { grid-template-columns: 1fr; }
  .recipe-title { font-size: 10px; }
}

/* Lien cliquable dans une info-bulle bonus (bloc "?") */
.bonus-lien {
  pointer-events: auto;      /* la bulle est pointer-events:none — le lien reste cliquable */
  color: #ffd60a;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.bonus-lien:hover { color: #fff3c4; }

/* ---------- Diorama 3D (Three.js) ---------- */
#diorama {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
#diorama canvas {
  display: block;
}

/* plateau 2D masqué : seule la logique (game.js) l'utilise encore */
#board-frame,
#board-shadow {
  display: none !important;
}

.demo-banner{position:fixed;z-index:500;top:8px;left:50%;transform:translateX(-50%);padding:7px 11px;border:1px solid #59e3ff66;border-radius:20px;background:#07101ee8;color:#9beaff;font:700 8px 'Share Tech Mono',monospace;letter-spacing:.08em;white-space:nowrap;pointer-events:none}

