/* =============================================================================
   LEARNING HTML & CSS — APPLICATION STYLES (ÉPURÉ, SANS ÉMOJI)
   ============================================================================= */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #121824;
  --bg-tertiary: #1b2333;
  --bg-elevated: #232e42;
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-light: rgba(255, 255, 255, 0.05);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --amber-primary: #f59e0b;
  --amber-dark: #d97706;
  --amber-glow: rgba(245, 158, 11, 0.35);

  --accent-blue: #38bdf8;
  --accent-dark: #0284c7;

  --success: #10b981;
  --error: #ef4444;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-elevated: #e2e8f0;

  --border-color: rgba(0, 0, 0, 0.1);
  --border-light: rgba(0, 0, 0, 0.05);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* =============================================================================
   BARRE SUPÉRIEURE (HEADER PROPRE)
   ============================================================================= */

.app-header {
  height: 52px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 30;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-symbol {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--amber-primary), var(--amber-dark));
  color: #ffffff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 2px 8px var(--amber-glow);
}

.brand-title {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.step-progress-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.step-progress-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.step-progress-track {
  width: 260px;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.step-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber-primary), #fbbf24);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-control-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.header-control-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

/* =============================================================================
   ESPACE DE TRAVAIL PLEIN ÉCRAN
   ============================================================================= */

.workspace-fullscreen {
  flex: 1;
  display: flex;
  height: calc(100vh - 52px);
  overflow: hidden;
  position: relative;
}

/* SECTION GAUCHE : ÉDITEUR */
.editor-section {
  width: 50%;
  height: 100%;
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  min-width: 280px;
  max-width: calc(100% - 280px);
}

/* POIGNÉE DE SÉPARATION ÉDITEUR / APERÇU (DRAGGABLE SPLIT RESIZER) */
.split-resizer {
  width: 6px;
  background: var(--bg-tertiary);
  cursor: col-resize;
  position: relative;
  user-select: none;
  flex-shrink: 0;
  transition: background 0.15s ease;
  z-index: 25;
}

.split-resizer:hover,
.split-resizer.dragging {
  background: var(--amber-primary);
  box-shadow: 0 0 10px var(--amber-glow);
}

.split-resizer::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 32px;
  background: var(--text-muted);
  border-radius: 2px;
}

/* SECTION DROITE : RENDU */
.preview-section {
  flex: 1;
  height: 100%;
  background-color: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 280px;
}

.preview-route-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-route-pill {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--accent-blue);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}


.editor-toolbar {
  height: 42px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}

.code-tabs-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  max-width: calc(100% - 190px);
}

.code-tabs {
  display: flex;
  gap: 4px;
}

.code-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: var(--font-mono);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.code-tab.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.tab-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0 2px;
  border-radius: 3px;
  line-height: 1;
  transition: color 0.15s ease;
}

.tab-close-btn:hover {
  color: var(--error);
  background: rgba(239, 68, 68, 0.15);
}

.create-file-btn {
  background: rgba(245, 158, 11, 0.12);
  border: 1px dashed var(--amber-primary);
  color: var(--amber-primary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.create-file-btn:hover {
  background: var(--amber-primary);
  color: #ffffff;
}


.editor-actions {
  display: flex;
  gap: 6px;
}

.clean-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.clean-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.editor-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

.code-editor-wrapper {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #10141d;
}

[data-theme="light"] .code-editor-wrapper {
  background: #ffffff;
}

.line-numbers-gutter {
  width: 48px;
  background: #0b0e15;
  color: #475569;
  padding: 16px 8px 16px 0;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  user-select: none;
  border-right: 1px solid #1e2430;
  overflow: hidden;
  flex-shrink: 0;
}

[data-theme="light"] .line-numbers-gutter {
  background: #f8fafc;
  color: #94a3b8;
  border-right: 1px solid #e2e8f0;
}

.line-num {
  display: block;
  height: 1.6em;
}

.code-textarea {
  flex: 1;
  width: 100%;
  height: 100%;
  background: transparent;
  color: #f8fafc;
  border: none;
  outline: none;
  resize: none;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  tab-size: 2;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  overflow-x: auto;
}

[data-theme="light"] .code-textarea {
  color: #0f172a;
}

.editor-status-bar {
  height: 24px;
  background: #007acc;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 14px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 500;
  flex-shrink: 0;
}

/* SECTION DROITE : RENDU */
.preview-section {
  width: 50%;
  height: 100%;
  background-color: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-toolbar {
  height: 42px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}

.preview-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.viewport-switcher {
  display: flex;
  background: var(--bg-primary);
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.viewport-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.viewport-btn.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
}

.preview-stage {
  flex: 1;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 16px;
}

[data-theme="light"] .preview-stage {
  background: #e2e8f0;
}

.preview-wrapper {
  background: #ffffff;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), height 0.3s;
}

.preview-wrapper.viewport-desktop {
  width: 100%;
  height: 100%;
}

.preview-wrapper.viewport-tablet {
  width: 768px;
  height: 95%;
}

.preview-wrapper.viewport-mobile {
  width: 375px;
  height: 95%;
}

.preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

/* =============================================================================
   WIDGET EN BAS À DROITE : MAÎTRE BODHI (STYLE VISUAL NOVEL RAFFINÉ)
   ============================================================================= */

.bodhi-widget-container {
  position: fixed;
  bottom: 20px;
  right: 24px;
  width: 520px;
  max-width: calc(100vw - 36px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.bodhi-avatar-wrapper {
  position: relative;
  display: flex;
  justify-content: flex-end;
  padding-right: 36px;
  margin-bottom: -22px;
  z-index: 1;
  pointer-events: auto;
  transition: all 0.2s ease;
}

.bodhi-avatar-controls {
  position: absolute;
  top: 6px;
  right: 32px;
  display: flex;
  gap: 4px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  padding: 3px 6px;
  border-radius: 20px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 15;
}

.bodhi-avatar-wrapper:hover .bodhi-avatar-controls {
  opacity: 1;
  transform: translateY(0);
}

.bodhi-avatar-zoom-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.bodhi-avatar-zoom-btn:hover {
  background: var(--amber-primary);
  color: #000;
  border-color: var(--amber-primary);
}

.bodhi-avatar-resizer {
  position: absolute;
  top: 0;
  right: 36px;
  width: var(--bodhi-avatar-size, 200px);
  height: 20px;
  cursor: ns-resize;
  z-index: 12;
  background: transparent;
  border-top: 3px dashed transparent;
  transition: border-color 0.2s ease;
}

.bodhi-avatar-wrapper:hover .bodhi-avatar-resizer {
  border-top-color: rgba(245, 158, 11, 0.5);
}

.bodhi-bust {
  width: var(--bodhi-avatar-size, 200px);
  height: calc(var(--bodhi-avatar-size, 200px) * 0.9);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  animation: floatBodhi 4s ease-in-out infinite;
  transform-origin: bottom center;
  transition: width 0.15s ease, height 0.15s ease;
}

.bodhi-avatar-img {
  max-height: var(--bodhi-avatar-size, 200px);
  max-width: calc(var(--bodhi-avatar-size, 200px) * 1.3);
  width: auto;
  height: 100%;
  object-fit: contain;
  border-radius: 20px 20px 0 0;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
  mask-image: linear-gradient(to bottom, black 82%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 82%, transparent 100%);
  user-select: none;
  pointer-events: none;
}

@keyframes floatBodhi {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.bodhi-pop {
  animation: popBodhi 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popBodhi {
  0% {
    transform: scale(0.92) translateY(6px);
  }
  60% {
    transform: scale(1.05) translateY(-3px);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

/* POIGNÉE DE REDIMENSIONNEMENT DIRECTEMENT SUR LE COIN DE LA CARTE DE DIALOGUE */
.bodhi-resize-handle {
  position: absolute;
  top: 0;
  left: 0;
  width: 26px;
  height: 26px;
  cursor: nwse-resize;
  z-index: 20;
  pointer-events: auto;
  border-top-left-radius: 24px;
}

.bodhi-resize-handle::after {
  content: '';
  position: absolute;
  top: 7px;
  left: 7px;
  width: 11px;
  height: 11px;
  border-top: 2.5px solid #d97706;
  border-left: 2.5px solid #d97706;
  border-radius: 3px 0 0 0;
}


/* BOÎTE DE DIALOGUE CRÈME ÉLÉGANTE (STYLE SLIME RANCHER & VISUAL NOVEL) */
.bodhi-dialogue-card {
  background: linear-gradient(180deg, #fffef9 0%, #faf3e1 100%);
  border: 3px solid #dfcfb2;
  border-radius: 24px;
  padding: 22px 24px 16px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), inset 0 2px 4px rgba(255, 255, 255, 0.9);
  position: relative;
  z-index: 2;
  pointer-events: auto;
  transition: padding 0.3s ease, border-radius 0.3s ease;
}

.bodhi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  min-height: 26px;
}

/* BADGE PILULE BLEU SLIME RANCHER */
.bodhi-name-badge {
  background: #38bdf8;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  border: 2px solid #ffffff;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.45);
  position: absolute;
  top: -15px;
  left: 24px;
}

.bodhi-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.bodhi-step-badge {
  font-size: 0.74rem;
  font-weight: 700;
  color: #8c7355;
  background: #eedfc7;
  padding: 3px 10px;
  border-radius: 12px;
}

.bodhi-icon-btn {
  background: rgba(46, 34, 22, 0.08);
  border: 1px solid rgba(46, 34, 22, 0.16);
  color: #78350f;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 13px;
  font-size: 0.76rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.bodhi-icon-btn:hover {
  background: rgba(46, 34, 22, 0.18);
  transform: scale(1.08);
}


/* CONTENEUR DE PAROLE DE BODHI */
.bodhi-speech-container {
  color: #2e2216;
  font-size: 0.88rem;
  line-height: 1.55;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 8px;
  margin-bottom: 14px;
  padding-right: 6px;
}

.bodhi-speech-container::-webkit-scrollbar {
  width: 5px;
}

.bodhi-speech-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 4px;
}

.bodhi-speech-container::-webkit-scrollbar-thumb {
  background: #dfcfb2;
  border-radius: 4px;
}

.bodhi-speech-bubble {
  margin-bottom: 10px;
}

.bodhi-speech-intro {
  font-size: 0.94rem;
  font-weight: 550;
  color: #2e2216;
  line-height: 1.6;
  font-style: italic;
}

/* PROVERBE DU MAÎTRE */
.bodhi-proverb {
  font-size: 0.78rem;
  font-weight: 700;
  color: #92400e;
  background: rgba(245, 158, 11, 0.12);
  border-left: 3px solid #f59e0b;
  padding: 6px 12px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 10px;
  line-height: 1.5;
}

/* BOÎTE D'OBJECTIFS / MISSION */
.bodhi-task-box {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #dfcfb2;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 8px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
}

.bodhi-task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.bodhi-task-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #78350f;
}

.bodhi-target-badge {
  background: #1e293b;
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.bodhi-task-list {
  padding-left: 18px;
  font-size: 0.85rem;
  color: #3b2816;
  line-height: 1.55;
}

.bodhi-task-list li {
  margin-bottom: 5px;
}

.bodhi-task-list code {
  background: #f1e4cb;
  color: #b91c1c;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.86em;
  font-weight: 600;
}

/* TIROIR DE QUESTIONS INTERACTIVES POUR BODHI */
.bodhi-qa-drawer {
  background: #ffffff;
  border: 2px solid #dfcfb2;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  max-height: 280px;
  overflow-y: auto;
  animation: qaSlideIn 0.22s ease-out;
}

.bodhi-qa-drawer.hidden {
  display: none;
}

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

.qa-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid #ebdcc5;
  margin-bottom: 10px;
}

.qa-drawer-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #78350f;
}

.qa-close-btn {
  background: transparent;
  border: none;
  color: #8c7355;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.qa-close-btn:hover {
  color: #451a03;
}

.qa-category-group {
  margin-bottom: 12px;
}

.qa-category-title {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b45309;
  margin-bottom: 6px;
}

.qa-category-items {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.qa-question-pill {
  background: #fdf8ef;
  border: 1px solid #e7d8c0;
  border-radius: 8px;
  padding: 7px 11px;
  text-align: left;
  font-size: 0.8rem;
  color: #2e2216;
  cursor: pointer;
  transition: all 0.16s ease;
  line-height: 1.4;
  font-family: inherit;
}

.qa-question-pill:hover {
  background: #fbf0d8;
  border-color: #d97706;
  transform: translateX(3px);
}

/* CARTE DE RÉPONSE DE BODHI */
.bodhi-qa-answer-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.qa-user-bubble {
  background: #f1f5f9;
  border-radius: 12px 12px 2px 12px;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  font-size: 0.84rem;
  color: #334155;
  align-self: flex-end;
  max-width: 90%;
}

.qa-bodhi-bubble {
  background: #ffffff;
  border-radius: 12px 12px 12px 2px;
  padding: 12px 14px;
  border: 1px solid #fcd34d;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.12);
  font-size: 0.88rem;
  color: #2e2216;
  line-height: 1.6;
}

.qa-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: #b45309;
}

.btn-return-mission {
  background: #38bdf8;
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: var(--transition);
}

.btn-return-mission:hover {
  background: #0284c7;
}

/* GRANDE RÉVÉLATION FINALE (ÉTAPE 24) */
.bodhi-grand-revelation {
  background: linear-gradient(135deg, #78350f 0%, #1e1b4b 100%);
  color: #ffffff;
  padding: 16px;
  border-radius: 14px;
  margin-top: 10px;
  border: 2px solid #f59e0b;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.35);
}

.bodhi-ending-artwork-wrap {
  width: 100%;
  margin-bottom: 14px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid rgba(253, 224, 71, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

.bodhi-ending-artwork {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.bodhi-ending-artwork:hover {
  transform: scale(1.03);
}

.revelation-text {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 8px;
}

.revelation-gold {
  font-size: 1rem;
  font-weight: 900;
  color: #fde047;
  line-height: 1.5;
}

/* BULLE DE CONSEIL SECRET */
.bodhi-hint-bubble {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 10px;
  color: #78350f;
  font-size: 0.86rem;
  line-height: 1.55;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.18);
  animation: hintSlideDown 0.25s ease-out;
}

@keyframes hintSlideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bodhi-hint-label {
  font-weight: 800;
  display: block;
  margin-bottom: 4px;
  color: #b45309;
}

.bodhi-hint-text {
  font-weight: 500;
}

/* RETOUR DE VALIDATION (SUCCÈS / ERREUR) */
.bodhi-feedback {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 10px;
  font-size: 0.86rem;
  line-height: 1.5;
}

.bodhi-feedback.success {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}

.bodhi-feedback.error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.bodhi-feedback-title {
  font-weight: 800;
  margin-bottom: 4px;
  font-size: 0.92rem;
}

.bodhi-next-banner {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(6, 95, 70, 0.2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ACTIONS DE LA CARTE */
.bodhi-card-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.btn-bodhi-primary {
  background: linear-gradient(135deg, var(--amber-primary) 0%, var(--amber-dark) 100%);
  color: #ffffff;
  border: none;
  padding: 9px 16px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--amber-glow);
  transition: var(--transition);
  flex: 1.3;
  text-align: center;
}

.btn-bodhi-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--amber-glow);
}

.btn-bodhi-secondary {
  background: rgba(46, 34, 22, 0.08);
  border: 1px solid rgba(46, 34, 22, 0.16);
  color: #451a03;
  padding: 8px 10px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  flex: 1;
  text-align: center;
}

.btn-bodhi-secondary:hover {
  background: rgba(46, 34, 22, 0.16);
  transform: translateY(-1px);
}

.bodhi-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px dashed #decbb0;
}

.btn-nav-step {
  background: transparent;
  border: none;
  font-size: 0.76rem;
  font-weight: 700;
  color: #8c7355;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
}

.btn-nav-step:hover {
  color: #451a03;
  text-decoration: underline;
}

.btn-nav-step:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  text-decoration: none !important;
  color: #a8947d;
}

/* ÉTAT RÉDUIT (MINIMISÉ) */
.bodhi-widget-container.minimized {
  width: 240px;
}

.bodhi-widget-container.minimized .bodhi-bust {
  width: 90px;
  height: 80px;
}

.bodhi-widget-container.minimized .bodhi-avatar-img {
  max-height: 80px;
}

.bodhi-widget-container.minimized .bodhi-dialogue-card {
  padding: 10px 16px;
  border-radius: var(--radius-full);
}

.bodhi-widget-container.minimized .bodhi-speech-container,
.bodhi-widget-container.minimized .bodhi-card-actions,
.bodhi-widget-container.minimized .bodhi-card-footer {
  display: none;
}


/* =============================================================================
   CINÉMATIQUE AVEC MAÎTRE BODHI (STYLE ÉPURÉ)
   ============================================================================= */

.cinematic-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #1b2333 0%, #080c14 100%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px;
  transition: opacity 0.4s ease;
}

.cinematic-overlay.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.cinematic-banner {
  text-align: center;
}

.cinematic-badge {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-primary);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cinematic-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.cinematic-bodhi-avatar {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 3px solid var(--amber-primary);
  box-shadow: 0 10px 30px var(--amber-glow);
  margin-bottom: 24px;
  background: #1e293b;
}

.cinematic-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cinematic-quote {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 12px;
  line-height: 1.35;
}

.cinematic-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.cinematic-footer {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}

.cinematic-progress-bar-bg {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}

.cinematic-progress-bar {
  height: 100%;
  background: var(--amber-primary);
  width: 25%;
  transition: width 0.4s ease;
}

.cinematic-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-ghost-skip {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-ghost-skip:hover {
  color: var(--text-primary);
}

.btn-gold {
  background: linear-gradient(135deg, var(--amber-primary), var(--amber-dark));
  color: #ffffff;
  border: none;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--amber-glow);
  transition: var(--transition);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--amber-glow);
}

/* =============================================================================
   MODALES (GRIMOIRE)
   ============================================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-card.modal-lg {
  max-width: 820px;
}

.modal-card.modal-xl {
  max-width: 1060px;
  width: 95vw;
  height: 88vh;
  max-height: 88vh;
}

.modal-card.modal-sm {
  max-width: 440px;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.close-modal-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.close-modal-btn:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--amber-primary);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.search-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
  border-color: var(--amber-primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

#new-file-input {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.create-file-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.5;
}

.create-file-desc code {
  color: var(--amber-primary);
  font-family: var(--font-mono);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
}

.create-file-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn-modal-confirm {
  flex: 1;
  background: var(--amber-primary);
  color: #000;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-modal-confirm:hover {
  background: var(--amber-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.btn-modal-cancel {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-modal-cancel:hover {
  background: var(--bg-primary);
  border-color: var(--border-light);
}

/* =============================================================================
   L'INTERNET DE MAÎTRE BODHI (ENCYCLOPÉDIE & CHRONIQUES HISTORIQUES)
   ============================================================================= */

.internet-modal-card {
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(245, 158, 11, 0.12);
}

.internet-header {
  background: var(--bg-tertiary);
  padding: 14px 20px;
}

.internet-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.internet-browser-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.browser-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.browser-dot.dot-red { background: #ef4444; }
.browser-dot.dot-yellow { background: #f59e0b; }
.browser-dot.dot-green { background: #10b981; }

.internet-url-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.internet-nav-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 20px 0;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.internet-nav-tab {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.internet-nav-tab:hover {
  color: var(--text-primary);
}

.internet-nav-tab.active {
  color: var(--amber-primary);
  border-bottom-color: var(--amber-primary);
}

.internet-tab-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.internet-tab-pane.hidden {
  display: none;
}

.internet-toolbar {
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.internet-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: none;
}

.internet-counter-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--amber-primary);
  white-space: nowrap;
}

.internet-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 84px;
  overflow-y: auto;
  padding-bottom: 2px;
}

.internet-pill-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.internet-pill-btn:hover {
  color: var(--text-primary);
  border-color: var(--amber-primary);
}

.internet-pill-btn.active {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--amber-primary);
  color: var(--amber-primary);
  font-weight: 700;
}

.internet-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.cheatsheet-category-block {
  margin-bottom: 26px;
}

.cheatsheet-cat-title {
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--amber-primary);
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cheatsheet-cat-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(245, 158, 11, 0.4), transparent);
}

.cheatsheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.cheatsheet-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.cheatsheet-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.cheatsheet-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.cheatsheet-rule-name {
  font-size: 0.92rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--amber-primary);
}

.cheatsheet-cat-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.cheatsheet-rule-desc {
  font-size: 0.79rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 4px;
}

.cheatsheet-code-wrap {
  position: relative;
  margin-top: 4px;
}

.cheatsheet-rule-code {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 8px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.77rem;
  color: #f8fafc;
  display: block;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 110px;
  overflow-y: auto;
}

.cheatsheet-copy-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.cheatsheet-code-wrap:hover .cheatsheet-copy-btn {
  opacity: 1;
}

.cheatsheet-copy-btn:hover {
  color: var(--amber-primary);
  border-color: var(--amber-primary);
}

.cheatsheet-tip-box {
  margin-top: 6px;
  padding: 7px 10px;
  background: rgba(245, 158, 11, 0.08);
  border-left: 2px solid var(--amber-primary);
  border-radius: 0 4px 4px 0;
  font-size: 0.74rem;
  color: #d97706;
  line-height: 1.4;
}

/* =============================================================================
   CHRONIQUES HISTORIQUES DE L'INTERNET
   ============================================================================= */

.internet-chronicles-container {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.internet-chronicle-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.internet-chronicle-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.chronicle-media-wrap {
  position: relative;
  min-height: 220px;
  background: #000;
  overflow: hidden;
}

.chronicle-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.internet-chronicle-card:hover .chronicle-img {
  transform: scale(1.04);
}

.chronicle-year-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--amber-primary);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 4px;
}

.chronicle-content {
  padding: 18px 20px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}

.chronicle-content h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.chronicle-lead {
  font-style: italic;
  color: var(--amber-primary);
  font-weight: 600;
  font-size: 0.85rem;
  border-left: 2px solid var(--amber-primary);
  padding-left: 8px;
}

.chronicle-content p {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.chronicle-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.chronicle-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--accent-blue);
}

@media (max-width: 800px) {
  .internet-chronicle-card {
    grid-template-columns: 1fr;
  }
  .chronicle-content {
    padding: 16px 20px;
  }
}

/* =============================================================================
   MODALE DES CODES SECRETS
   ============================================================================= */

.secret-trigger-btn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(168, 85, 247, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--amber-primary);
  font-weight: 700;
}

.secret-trigger-btn:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(168, 85, 247, 0.25));
  border-color: var(--amber-primary);
  color: #fff;
}

.secret-modal-card {
  max-width: 720px;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(168, 85, 247, 0.15);
}

.secret-header {
  background: var(--bg-tertiary);
}

.secret-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.secret-vault-icon {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid var(--amber-primary);
  color: var(--amber-primary);
  border-radius: 4px;
}

.secret-modal-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.secret-modal-subtitle {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.secret-input-wrapper {
  display: flex;
  gap: 10px;
}

.secret-code-input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber-primary);
  outline: none;
  transition: border-color 0.2s ease;
}

.secret-code-input:focus {
  border-color: var(--amber-primary);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

.secret-code-feedback {
  font-size: 0.8rem;
  min-height: 18px;
  font-weight: 600;
}

.secret-code-feedback.error {
  color: #ef4444;
}

.secret-code-feedback.success {
  color: #10b981;
}

.secret-endings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 6px;
}

.secret-ending-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.secret-ending-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.secret-ending-card.card-phare {
  border-top: 3px solid #f59e0b;
}

.secret-ending-card.card-gardien {
  border-top: 3px solid #6366f1;
}

.secret-ending-card.card-rebelle {
  border-top: 3px solid #ec4899;
}

.secret-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ending-pill {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
}

.pill-phare {
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
}

.pill-gardien {
  background: rgba(99, 102, 241, 0.18);
  color: #818cf8;
}

.pill-rebelle {
  background: rgba(236, 72, 153, 0.18);
  color: #f472b6;
}

.secret-card-top h4 {
  font-size: 0.92rem;
  font-weight: 800;
  margin: 0;
}

.secret-desc {
  font-size: 0.77rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.secret-code-label {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.secret-code-label strong {
  font-family: var(--font-mono);
  color: var(--amber-primary);
  background: var(--bg-primary);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--border-color);
}

.btn-ending-trigger {
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-ending-trigger:hover {
  background: var(--amber-primary);
  border-color: var(--amber-primary);
  color: #000;
}

/* =============================================================================
   TOAST
   ============================================================================= */

.toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 300;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  border-color: var(--success);
  color: #34d399;
}

.toast.error {
  border-color: var(--error);
  color: #f87171;
}

.toast.info {
  border-color: var(--amber-primary);
  color: #fbbf24;
}

.hidden {
  display: none !important;
}

/* =============================================================================
   MODALE DE CRÉATION DE FICHIER
   ============================================================================= */

.modal-sm {
  max-width: 440px;
}

.create-file-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.5;
}

.create-file-desc code {
  color: var(--amber-primary);
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
}

.create-file-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

/* =============================================================================
   MOTEUR D'AUTOCOMPLÉTION INTELLISENSE STYLE VS CODE
   ============================================================================= */

.intellisense-popup {
  position: fixed;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55);
  z-index: 1000;
  min-width: 290px;
  max-width: 420px;
  max-height: 220px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  border-left: 3px solid var(--amber-primary);
  animation: intelliFade 0.12s ease-out;
}

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

.intellisense-popup.hidden {
  display: none;
}

.intellisense-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.1s ease;
  user-select: none;
}

.intellisense-item:hover,
.intellisense-item.selected {
  background: var(--bg-elevated);
}

.intellisense-type {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  letter-spacing: -0.05em;
}

.intellisense-type.tag { background: rgba(56, 189, 248, 0.18); color: #38bdf8; }
.intellisense-type.snippet { background: rgba(245, 158, 11, 0.18); color: #f59e0b; }
.intellisense-type.prop { background: rgba(168, 85, 247, 0.18); color: #c084fc; }

.intellisense-label {
  font-weight: 600;
  color: var(--text-primary);
}

.intellisense-detail {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

/* =============================================================================
   CONVERSATIONS MULTI-TOURS & CHOIX DE RÉPLIQUES AVEC BODHI
   ============================================================================= */

.bodhi-qa-conversation-flow {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qa-choices-container {
  margin: 10px 0 4px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qa-choices-label {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #b45309;
  letter-spacing: 0.05em;
}

.qa-choices-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-qa-choice {
  background: #fffdfa;
  border: 1.5px solid #d97706;
  color: #78350f;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
  line-height: 1.45;
}

.btn-qa-choice:hover {
  background: #fef3c7;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.2);
}

.qa-end-dialogue-tag {
  font-size: 0.8rem;
  font-style: italic;
  color: #8c7355;
  padding: 8px 0;
  text-align: center;
}

.qa-question-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qa-question-pill.locked {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f1ede5;
  border-color: #dfcfb2;
}

.qa-lock-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #92400e;
  background: #fde68a;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.qa-q-step {
  font-size: 0.68rem;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

/* BADGE ALERTE NOUVELLES QUESTIONS */
.btn-bodhi-secondary {
  position: relative;
}

.ask-btn-badge {
  position: absolute;
  top: -8px;
  right: -5px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: alertBounce 1.8s infinite ease-in-out;
  z-index: 5;
}

.alert-badge-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(220, 38, 38, 0.6));
}

@keyframes alertBounce {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-5px) scale(1.1);
  }
}

.qa-new-badge {
  font-size: 0.72rem;
  font-weight: 900;
  color: #ffffff;
  background: #ef4444;
  padding: 1px 7px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.45);
  margin-left: auto;
}

/* =============================================================================
   GLOSSAIRE INTERACTIF DE MAÎTRE BODHI (MOTS-CLÉS CLIQUABLES DANS LES DIALOGUES)
   ============================================================================= */

.glossary-term-btn {
  background: rgba(217, 119, 6, 0.12);
  border: none;
  border-bottom: 1.5px dotted #d97706;
  color: #92400e;
  padding: 1px 5px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95em;
  font-family: inherit;
  transition: all 0.15s ease;
  display: inline;
  vertical-align: baseline;
  text-decoration: none;
  user-select: text;
}

.glossary-term-btn:hover {
  background: rgba(217, 119, 6, 0.25);
  color: #78350f;
  border-bottom-style: solid;
  transform: translateY(-1px);
}

.glossary-popover {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  background: #fffdf9;
  border: 2px solid #d97706;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  z-index: 50;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: glossaryPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  color: #2e2216;
}

.glossary-popover.hidden {
  display: none;
}

@keyframes glossaryPopIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.glossary-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.glossary-popover-badge {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(217, 119, 6, 0.15);
  color: #b45309;
  padding: 3px 9px;
  border-radius: var(--radius-full);
}

.glossary-close-btn {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.glossary-close-btn:hover {
  color: #1f2937;
}

.glossary-popover-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #78350f;
  margin: 0;
  font-family: var(--font-mono);
}

.glossary-popover-desc {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #451a03;
  margin: 0;
}

.glossary-code-box {
  background: #1e293b;
  border-radius: 8px;
  padding: 8px 12px;
  overflow-x: auto;
  border: 1px solid #334155;
}

.glossary-code-box pre {
  margin: 0;
}

.glossary-code-box code {
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre;
}

.glossary-popover-tip {
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  padding: 6px 10px;
  border-radius: 4px;
}

.glossary-tip-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #92400e;
  display: block;
  margin-bottom: 2px;
}

.glossary-popover-tip p {
  font-size: 0.78rem;
  color: #78350f;
  line-height: 1.4;
  margin: 0;
  font-style: italic;
}

.glossary-popover-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.btn-glossary-grimoire {
  background: #d97706;
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 3px 8px rgba(217, 119, 6, 0.35);
}

.btn-glossary-grimoire:hover {
  background: #b45309;
  transform: translateY(-1px);
}


