/* ===== COMPONENTS.CSS ===== */

/* === BANDEAU SÉQUENCE (prérequis non terminé) === */
.sequence-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 20px;
  background: rgba(245, 158, 11, 0.14);
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #e0e6ed);
  animation: none;
}
.sequence-banner a {
  color: var(--accent, #5ec4d4);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sequence-banner-close {
  background: none;
  border: none;
  color: var(--text3, #7a8599);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.sequence-banner-close:hover {
  color: var(--text, #e0e6ed);
  background: rgba(255, 255, 255, 0.08);
}
@keyframes seqBannerIn {
  from { opacity: 0; transform: translateY(-100%); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === BOUTON RETOUR NEURONAL === */
.btn-back-neural {
  position: fixed;
  top: 82px;
  left: 18px;
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 14px;
  border: 1.5px solid rgba(94,196,212,0.20);
  border-radius: var(--r-md);
  background: rgba(22,32,50,0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--accent, #5ec4d4);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.26);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
}
.btn-back-neural:hover {
  border-color: rgba(94,196,212,0.34);
  box-shadow: 0 6px 20px rgba(0,0,0,0.30);
  transform: translateY(-1px);
  color: #fff;
}
.btn-back-neural svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s;
}
.btn-back-neural:hover svg {
  transform: translateX(-3px);
}

/* === BREADCRUMB === */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 12px;
}

/* Laptop screens (1366px+) */
@media (min-width: 1366px) {
  .sequence-banner {
    padding: 12px 24px;
    font-size: 15px;
    gap: 16px;
  }

  .btn-back-neural {
    top: 88px;
    left: 24px;
    padding: 12px 20px 12px 16px;
    font-size: 14px;
  }

  .btn-back-neural svg {
    width: 17px;
    height: 17px;
  }

  .breadcrumb {
    font-size: 13px;
    margin-bottom: 14px;
  }
}

/* Large PC screens (1920px+) */
@media (min-width: 1920px) {
  .sequence-banner {
    padding: 14px 32px;
    font-size: 16px;
    gap: 18px;
  }

  .sequence-banner-close {
    font-size: 18px;
    padding: 3px 8px;
  }

  .btn-back-neural {
    top: 96px;
    left: 32px;
    padding: 13px 22px 13px 18px;
    font-size: 15px;
    gap: 10px;
  }

  .btn-back-neural svg {
    width: 18px;
    height: 18px;
  }

  .breadcrumb {
    font-size: 14px;
    gap: 8px;
    margin-bottom: 16px;
  }
}
.breadcrumb a {
  color: var(--text2);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--text3); }

/* === PAGE HEADER === */
.page-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(94,196,212,0.14);
  position: relative;
}
.page-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(50,93,169,0.18), rgba(94,196,212,0.12), rgba(131,189,69,0.09), transparent);
}
.page-header h1 {
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
.page-header p {
  color: #c8d6e8;
  font-size: 14px;
  text-shadow: none;
}
.page-header .page-icon {
  font-size: 32px;
  margin-bottom: 10px;
  display: block;
}

/* === CARDS === */
.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
  position: relative;
}
.card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(circle at 20% 20%, var(--neuron-glow), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card:hover::after { opacity: 0.35; }

.card-sm { padding: 16px; border-radius: var(--r-lg); }
.card-lg { padding: 32px; }

.card-accent {
  background:
    radial-gradient(circle at top left, rgba(94,196,212,0.06), transparent 40%),
    linear-gradient(180deg, rgba(18,31,50,0.96), rgba(14,22,37,0.9));
  border-color: rgba(94,196,212,0.16);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.04);
}

.card-title {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.card-desc { color: var(--text2); font-size: 13px; line-height: 1.6; }

/* === BOUTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-base);
  border: 1px solid transparent;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }

body.accessible-ui .btn {
  min-height: 52px;
  padding: 12px 22px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 14px;
}

.btn-primary {
  background: var(--gradient);
  color: #09111d;
  box-shadow: 0 8px 18px rgba(50,93,169,0.12);
  font-weight: 800;
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 20%, rgba(255,255,255,0.25) 50%, transparent 80%);
  transform: translateX(-100%);
  transition: none;
  pointer-events: none;
}
.btn-primary:hover { box-shadow: 0 10px 22px rgba(50,93,169,0.16); transform: translateY(-1px); }
.btn-primary:hover::before { animation: btnSynapseShimmer 0.6s ease forwards; }

@keyframes btnSynapseShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1.5px solid rgba(148,220,230,0.35);
}
.btn-secondary:hover { background: rgba(94,196,212,0.10); border-color: rgba(148,220,230,0.55); color: #ffffff; }

.btn-success {
  background: linear-gradient(135deg, #34d399, #059669);
  color: white;
  box-shadow: none;
}
.btn-success:hover { opacity: 0.9; }

.btn-danger {
  background: linear-gradient(135deg, #f87171, #dc2626);
  color: white;
}
.btn-danger:hover { opacity: 0.9; }

.btn-ghost {
  background: none;
  color: var(--text);
  border: 1.5px solid rgba(148,220,230,0.3);
}
.btn-ghost:hover { background: rgba(94,196,212,0.08); border-color: rgba(148,220,230,0.5); color: #ffffff; }

.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; font-weight: 600; }
.btn-icon { padding: 10px; border-radius: var(--r-md); }

.btn-block { width: 100%; }

.quick-play-toggle {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* === BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

body.accessible-ui .badge {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 13px;
}
.badge-blue   { background: rgba(50,93,169,0.18); color: #9fcbff; border: 1px solid rgba(94,196,212,0.22); }
.badge-green  { background: rgba(131,189,69,0.18); color: #d5f5a7; border: 1px solid rgba(131,189,69,0.24); }
.badge-yellow { background: rgba(243,201,105,0.18); color: #ffe49a; border: 1px solid rgba(243,201,105,0.22); }
.badge-red    { background: rgba(255,127,157,0.16); color: #ffb8c9; border: 1px solid rgba(255,127,157,0.24); }
.badge-purple { background: rgba(94,196,212,0.12); color: #9de6ef; border: 1px solid rgba(94,196,212,0.22); }
.badge-gray   { background: rgba(115,131,161,0.16); color: #d2d8e4; border: 1px solid rgba(115,131,161,0.22); }

body.accessible-ui .badge-blue   { color: #1a5298; }
body.accessible-ui .badge-green  { color: #2d6b18; }
body.accessible-ui .badge-yellow { color: #8a6d00; }
body.accessible-ui .badge-red    { color: #b91c38; }
body.accessible-ui .badge-purple { color: #0e7a8a; }
body.accessible-ui .badge-gray   { color: #4a5568; }

/* === PROGRESS === */
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.07);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--gradient);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.progress-fill::after {
  content: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 20%, rgba(255,255,255,0.3) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: none;
}
.progress-fill.green { background: var(--gradient2); }
.progress-fill.yellow { background: var(--gradient3); }

.progress-lg { height: 12px; border-radius: 6px; }
.progress-label {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text2);
  margin-bottom: 6px;
}

/* === KPI CARDS === */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--glass-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  text-align: center;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--synapse-color) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.kpi-card:hover::before { opacity: 1; }
.kpi-value {
  font-family: var(--font-head);
  font-size: 30px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
}
.kpi-label { font-size: 11px; color: var(--text3); margin-top: 4px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.8px; }
.kpi-sub { font-size: 12px; color: var(--text2); margin-top: 2px; }

.kpi-lbl,
.progress-label,
.quiz-progress-label,
.card p,
.card li,
.card label {
  color: var(--text2);
}

body.accessible-ui .page-header h1 {
  font-size: 34px;
}

body.accessible-ui .page-header p {
  font-size: 18px;
  line-height: 1.8;
}

/* === GAME BRIEF === */
.game-brief {
  display: grid;
  gap: 12px;
  margin: -12px 0 20px;
  padding: 14px 16px;
  border: 1px solid rgba(94,196,212,0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(94,196,212,0.10), transparent 30%),
    linear-gradient(180deg, rgba(20,29,47,0.95), rgba(13,20,35,0.92));
  box-shadow: 0 14px 28px rgba(0,0,0,0.18);
}

.game-brief-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.game-brief-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.game-brief-eyebrow {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(50,93,169,0.08);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.game-brief h2 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: 0;
  min-width: 0;
}

.game-brief-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.game-brief-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 8px;
  background: rgba(131,189,69,0.14);
  color: #a8d86a;
  font-size: 10px;
  font-weight: 800;
}

.game-brief-more {
  border-top: 1px solid rgba(50,93,169,0.10);
  padding-top: 10px;
}

.game-brief-more summary {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(50,93,169,0.07);
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}

.game-brief-more summary::-webkit-details-marker {
  display: none;
}

.game-brief-more summary::after {
  content: '+';
  margin-left: 8px;
}

.game-brief-more[open] summary::after {
  content: '-';
}

.game-brief-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.game-brief-grid div {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(94,196,212,0.12);
  border-radius: 8px;
  background: var(--surface);
}

.game-brief-grid dt {
  color: var(--text3);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-brief-grid dd {
  margin: 0;
  color: var(--text2);
  font-size: 13px;
  line-height: 1.55;
}

body.accessible-ui .game-brief {
  border-width: 2px;
}

body.accessible-ui .game-brief h2 {
  font-size: 17px;
}

body.accessible-ui .game-brief-grid dd {
  font-size: 15px;
}

@media (max-width: 760px) {
  .game-brief-main,
  .game-brief-line {
    display: grid;
    justify-content: stretch;
  }

  .game-brief-tags {
    justify-content: flex-start;
  }

  .game-brief-grid {
    grid-template-columns: 1fr;
  }
}

body.accessible-ui .card-title,
body.accessible-ui .section-title {
  font-size: 20px;
}

body.accessible-ui .kpi-card {
  padding: 24px;
  border-width: 2px;
}

body.accessible-ui .kpi-value {
  font-size: 36px;
}

body.accessible-ui .kpi-label {
  font-size: 13px;
  letter-spacing: 0.04em;
}

/* === GRID LAYOUTS === */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }

@media (min-width: 1200px) {
  .card {
    padding: 28px;
  }

  .card-lg {
    padding: 36px;
  }

  .btn-lg {
    padding: 15px 32px;
    font-size: 17px;
  }

  .page-header {
    margin-bottom: 38px;
    padding-bottom: 28px;
  }

  .page-header h1 {
    font-size: 32px;
  }

  .page-header p {
    max-width: 74ch;
    font-size: 15px;
    line-height: 1.75;
  }
}

@media (max-width: 900px) {
  .game-brief,
  .game-brief-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .grid-2, .grid-3, .grid-auto { grid-template-columns: 1fr; }
}

/* === EXERCICE ZONE === */
.exercise-zone {
  background:
    radial-gradient(circle at 85% 15%, rgba(94,196,212,0.06), transparent 35%),
    radial-gradient(circle at 10% 80%, rgba(50,93,169,0.05), transparent 30%),
    var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.exercise-zone::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--synapse-color), rgba(131,189,69,0.14), transparent);
  opacity: 0.7;
}
.exercise-phrase {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  line-height: 1.6;
}
.exercise-phrase .char {
  display: inline-block;
  transition: color 0.1s;
}
.exercise-phrase .char.correct { color: var(--success); }
.exercise-phrase .char.wrong   { color: var(--danger); text-decoration: underline; }
.exercise-phrase .char.current {
  color: var(--accent);
  background: rgba(79,142,247,0.2);
  border-radius: 3px;
  padding: 0 2px;
}

.feedback-text {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  min-height: 28px;
  margin: 12px 0;
  transition: color 0.2s ease;
}
.feedback-text.ok  { color: var(--success); animation: feedbackOk 0.5s ease; }
.feedback-text.err { color: var(--danger); animation: feedbackErr 0.4s ease; }

@keyframes feedbackOk {
  0% { opacity: 0; transform: translateY(6px) scale(0.95); }
  50% { transform: translateY(-2px) scale(1.03); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes feedbackErr {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-5px); }
  30% { transform: translateX(5px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
}

body.accessible-ui .feedback-text,
body.accessible-ui .result-subtitle,
body.accessible-ui .card-desc {
  font-size: 17px;
  line-height: 1.8;
}

.result-summary-card {
  text-align: center;
}

.result-emoji {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 14px;
}

.result-title {
  margin-bottom: 8px;
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
}

.result-subtitle {
  margin-bottom: 24px;
  color: var(--text2);
  font-size: 14px;
  line-height: 1.7;
}

.result-kpis {
  margin-bottom: 28px;
}

.result-share-row,
.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.result-share-row {
  margin-bottom: 12px;
}

.result-zone .card.card-accent.card-lg {
  text-align: center !important;
}

.result-zone #resEmoji {
  font-size: 56px !important;
  line-height: 1 !important;
  margin-bottom: 14px !important;
}

.result-zone #resTitle {
  margin-bottom: 8px !important;
  font-family: var(--font-head) !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  color: var(--text) !important;
}

.result-zone #resSubtitle {
  margin-bottom: 24px !important;
  color: var(--text2) !important;
  font-size: 14px !important;
  line-height: 1.7 !important;
}

.result-zone .kpi-grid {
  margin-bottom: 28px !important;
}

.result-zone .btn-share {
  margin-bottom: 0 !important;
}

.result-zone .btn-share,
.result-zone #btnNextExercise,
.result-zone #btnRestart,
.result-zone a.btn.btn-secondary.btn-lg {
  align-self: center;
}

.result-zone .card.card-accent.card-lg > div[style*="display:flex"] {
  justify-content: center !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
}

.result-zone .card.card-accent.card-lg > div[style*="margin-bottom:12px"] {
  margin-bottom: 12px !important;
}

@media (min-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
  }

  .kpi-card {
    padding: 24px;
  }

  .kpi-value {
    font-size: 34px;
  }

  .exercise-zone {
    padding: 40px;
  }

  .exercise-phrase {
    font-size: 25px;
    padding: 24px;
  }

  .quick-play-toggle {
    margin-bottom: 28px;
  }

  .result-emoji {
    font-size: 64px;
    margin-bottom: 16px;
  }

  .result-title {
    font-size: 28px;
  }

  .result-subtitle {
    font-size: 15px;
  }

  .result-zone #resEmoji {
    font-size: 64px !important;
    margin-bottom: 16px !important;
  }

  .result-zone #resTitle {
    font-size: 28px !important;
  }

  .result-zone #resSubtitle {
    font-size: 15px !important;
  }
}

/* === SCORE COUNTERS === */
.score-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 16px 0;
}
.score-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 20px;
  text-align: center;
}
.score-item .val {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
}
.score-item .lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text3);
}
.score-item.green .val { color: var(--success); }
.score-item.red .val   { color: var(--danger); }
.score-item.blue .val  { color: var(--accent); }

/* === ALERTS === */
.alert {
  padding: 14px 18px;
  border-radius: var(--r-md);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
  color: var(--text2);
  border: 1px solid var(--border);
  border-left-width: 4px;
}
.alert-info    { background: rgba(26,86,168,0.08); border-color: rgba(26,86,168,0.24); border-left-color: var(--accent); }
.alert-success { background: rgba(26,122,74,0.09); border-color: rgba(26,122,74,0.24); border-left-color: var(--success); }
.alert-warning { background: rgba(180,83,9,0.10); border-color: rgba(180,83,9,0.26); border-left-color: var(--warning); }
.alert-danger  { background: rgba(192,57,43,0.10); border-color: rgba(192,57,43,0.26); border-left-color: var(--danger); }

/* === TABS === */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg3);
  border-radius: var(--r-lg);
  padding: 4px;
  margin-bottom: 24px;
  width: fit-content;
}
.tab-btn {
  padding: 8px 18px;
  border-radius: var(--r-md);
  background: none;
  border: none;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}
.tab-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* === RING CHART === */
.ring-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-svg { transform: rotate(-90deg); }
.ring-bg   { fill: none; stroke: var(--bg3); stroke-width: 10; }
.ring-fill { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1); }
.ring-label { font-family: var(--font-head); font-size: 28px; font-weight: 800; fill: var(--text); }
.ring-sublabel { font-size: 11px; fill: var(--text3); }

/* === WORD CHIP === */
.word-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  cursor: grab;
  transition: all 0.2s;
  -webkit-user-select: none;
  user-select: none;
}
.word-chip:hover { background: var(--accent); color: white; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(94,196,212,0.16); }
.word-chip.selected { background: var(--accent2); color: white; border-color: var(--accent2); box-shadow: 0 0 0 2px rgba(131,189,69,0.14); }
.word-chip.correct { background: rgba(52,211,153,0.2); color: var(--success); border-color: var(--success); animation: chipCorrect 0.4s ease; }
.word-chip.wrong   { background: rgba(248,113,113,0.2); color: var(--danger); border-color: var(--danger); animation: chipWrong 0.35s ease; }

@keyframes chipCorrect {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes chipWrong {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

/* === DRAG DROP ZONE === */
.drop-zone {
  min-height: 60px;
  border: 2px dashed var(--border);
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px;
  padding: 16px;
  transition: all 0.2s;
}
.drop-zone.over {
  border-color: var(--accent);
  background: rgba(79,142,247,0.05);
  box-shadow: inset 0 0 0 1px rgba(94,196,212,0.08);
  animation: none;
}
/* === SUCCESS MODAL === */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  align-items: center; justify-content: center;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.modal-overlay.show { display: flex; }
.modal {
  background:
    radial-gradient(circle at 30% 20%, rgba(94,196,212,0.04), transparent 40%),
    var(--surface);
  border: 1px solid rgba(94,196,212,0.2);
  border-radius: var(--r-xl);
  padding: 40px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  animation: modalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}
.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent3), var(--accent), var(--accent2));
  opacity: 0.6;
}
@keyframes modalIn { from { transform: scale(0.85) translateY(10px); opacity: 0; filter: blur(4px); } to { transform: scale(1) translateY(0); opacity: 1; filter: blur(0); } }
.modal-icon { font-size: 48px; margin-bottom: 16px; display: none; }
.modal-title { font-family: var(--font-head); font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.modal-text { color: var(--text2); font-size: 14px; margin-bottom: 24px; }

/* === CONFETTI ANIMATION === */
@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
.confetti-piece {
  position: fixed;
  width: 8px; height: 8px;
  border-radius: 2px;
  animation: confetti-fall 2s ease-in forwards;
  pointer-events: none;
  z-index: 9999;
}

/* === PLACEHOLDER PAGE === */
.placeholder-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}
.placeholder-page .icon { font-size: 64px; margin-bottom: 20px; opacity: 0.5; }
.placeholder-page h2 { font-size: 22px; margin-bottom: 10px; }
.placeholder-page p { color: var(--text2); font-size: 14px; max-width: 360px; }
.placeholder-page .soon {
  margin-top: 24px;
  padding: 6px 18px;
  border: 1px dashed var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text3);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* === ANIMATIONS ENTRÉE (désactivées : les classes fixent l'état final sans jouer d'animation) === */
.fade-up,
.fade-in,
.scale-in,
.slide-in-left,
.neuron-reveal {
  animation: none;
  opacity: 1;
  transform: none;
  filter: none;
}
.delay-1,
.delay-2,
.delay-3,
.delay-4,
.delay-5,
.delay-6 {
  animation-delay: 0s;
  opacity: 1;
}

/* === XP RULES BANNER === */
.xp-rules {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg2));
  border: 1px solid rgba(79, 142, 247, 0.2);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 20px;
  flex-wrap: wrap;
  text-align: center;
}
.xp-rules-label { font-weight: 600; color: var(--accent); }

/* === XP RULES MODAL === */
#xp-rules-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
#xp-rules-modal.show {
  opacity: 1;
}
.xp-rules-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.xp-rules-dialog {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  width: 90%;
  max-width: 420px;
  animation: none;
}
.xp-rules-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.xp-rules-header h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
  font-family: var(--font-head);
}
.xp-rules-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text2);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.xp-rules-close:hover {
  color: var(--text);
}
.xp-rules-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.xp-rule-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.xp-rule-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.xp-rule-label {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
  margin-bottom: 2px;
}
.xp-rule-desc {
  color: var(--text2);
  font-size: 12px;
  line-height: 1.5;
}
.xp-rules-footer {
  padding: 0 24px 24px;
}

/* === EXERCISE MISSION === */
.exercise-mission {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}
.exercise-mission-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.exercise-mission-step {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(79, 142, 247, 0.12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  flex: 0 0 auto;
}
.exercise-mission-text {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

@media (max-width: 760px) {
  .exercise-mission {
    grid-template-columns: 1fr;
  }
}

/* === EXERCISE PEDAGOGY === */
.exercise-pedagogy-panel {
  margin: 24px 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(26,86,168,0.04) 0%, rgba(255,255,255,0.02) 100%);
  text-align: left;
}
.exercise-pedagogy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.exercise-pedagogy-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.exercise-pedagogy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.exercise-pedagogy-card {
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
}
.exercise-pedagogy-card strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.exercise-pedagogy-card p {
  margin: 0;
  color: var(--text2);
  font-size: 13px;
  line-height: 1.6;
}
.exercise-pedagogy-card-accent {
  background: linear-gradient(135deg, rgba(26,86,168,0.1) 0%, rgba(37,99,235,0.05) 100%);
  border-color: rgba(26,86,168,0.18);
}
.exercise-pedagogy-link {
  margin-top: 12px;
}

@media (max-width: 900px) {
  .exercise-pedagogy-grid {
    grid-template-columns: 1fr;
  }
}
