/* ==========================================================================
   TIMELINE : MINISTRES, PRÉSIDENTS & RÉFORMES DE L'ÉDUCATION NATIONALE
   Styles CSS - Version 2.1.0
   Architecture 3 Lignes Synchronisées :
   - Ligne 1 (Haut)   : Présidents (Chapeaux de mandat)
   - Ligne 2 (Milieu) : Réformes associées à chaque ministre
   - Ligne 3 (Bas)    : Ministres (Insertion relative Timeline)
   Zéro police Google, plein écran paysage, zéro footer
   ========================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  /* Palette chromatique */
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-surface: #1e293b;
  --bg-surface-elevated: #27354f;
  --bg-surface-hover: #334155;
  
  --border-subtle: #334155;
  --border-medium: #475569;
  --border-active: #3b82f6;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-blue: #2563eb;
  --accent-blue-light: #60a5fa;
  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.4);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.4);
  --accent-rose: #f43f5e;
  --accent-rose-glow: rgba(244, 63, 94, 0.35);
  --accent-purple: #8b5cf6;

  /* Thèmes par type de carte */
  --type-minister-color: #3b82f6;
  --type-president-color: #f59e0b;
  --type-reform-color: #10b981;

  --col-width: 136px;
  --minister-card-height: 146px;
  --reform-slot-height: 104px;
  --president-slot-height: 58px;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* Réinitialisation */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* Conteneur principal */
.app-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* ==========================================================================
   EN-TÊTE SUPÉRIEUR
   ========================================================================== */

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

.header-left {
  display: flex;
  align-items: center;
}

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

.logo-badge {
  width: 32px;
  height: 32px;
  background: var(--bg-surface-elevated);
  color: var(--accent-blue-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.25);
  border: 1px solid var(--border-medium);
}

.title-wrap h1 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.1;
  color: #ffffff;
}

.title-wrap .subtitle {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-blue-light);
  margin-left: 4px;
}

.version-tag {
  font-size: 10px;
  font-weight: 700;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--accent-gold);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  margin-left: 6px;
  vertical-align: middle;
}

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

/* Sélecteur de période temporelle avec calendrier précis */
.period-selector-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px 10px;
}

.period-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.period-inputs-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-field-box {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 1px 4px 1px 6px;
  transition: all var(--transition-fast);
}

.date-field-box:focus-within,
.date-field-box:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.date-sublabel {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  user-select: none;
}

.custom-date-input {
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  outline: none;
  padding: 2px 0;
  cursor: pointer;
  width: 102px;
}

/* Style de l'icône calendrier native dans Chrome/Edge/Firefox */
.custom-date-input::-webkit-calendar-picker-indicator {
  filter: invert(0.85);
  cursor: pointer;
  opacity: 0.8;
  padding: 0;
  margin-left: 2px;
  transition: opacity var(--transition-fast);
}

.custom-date-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  filter: invert(1);
}

.btn-cal-trigger {
  background: transparent;
  border: none;
  color: var(--accent-gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 3px;
  border-radius: 3px;
  transition: all var(--transition-fast);
}

.btn-cal-trigger:hover {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.preset-dropdown {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
}

.preset-dropdown:hover,
.preset-dropdown:focus {
  border-color: var(--accent-gold);
  color: #ffffff;
}

/* Sélecteur d'options à cocher dans le Header */
.category-selectors {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px 8px;
}

.selectors-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 2px;
}

.custom-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  background: rgba(255, 255, 255, 0.04);
}

.custom-checkbox input[type="checkbox"] {
  display: none;
}

.chk-box {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  transition: all var(--transition-fast);
}

.chk-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

/* Ministres */
.chk-type-minister .chk-box {
  border: 1.5px solid var(--type-minister-color);
  color: transparent;
}
.chk-type-minister.is-checked,
.chk-type-minister:has(input:checked) {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.4);
}
.chk-type-minister.is-checked .chk-box,
.chk-type-minister:has(input:checked) .chk-box {
  background: var(--type-minister-color);
  color: #ffffff;
}
.chk-type-minister.is-checked .chk-text,
.chk-type-minister:has(input:checked) .chk-text {
  color: #ffffff;
}

/* Réformes */
.chk-type-reform .chk-box {
  border: 1.5px solid var(--type-reform-color);
  color: transparent;
}
.chk-type-reform.is-checked,
.chk-type-reform:has(input:checked) {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.4);
}
.chk-type-reform.is-checked .chk-box,
.chk-type-reform:has(input:checked) .chk-box {
  background: var(--type-reform-color);
  color: #ffffff;
}
.chk-type-reform.is-checked .chk-text,
.chk-type-reform:has(input:checked) .chk-text {
  color: #ffffff;
}

/* Présidents */
.chk-type-president .chk-box {
  border: 1.5px solid var(--type-president-color);
  color: transparent;
}
.chk-type-president.is-checked,
.chk-type-president:has(input:checked) {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.4);
}
.chk-type-president.is-checked .chk-box,
.chk-type-president:has(input:checked) .chk-box {
  background: var(--type-president-color);
  color: #090d16;
}
.chk-type-president.is-checked .chk-text,
.chk-type-president:has(input:checked) .chk-text {
  color: #ffffff;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
}

.stat-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-value {
  color: #ffffff;
  font-weight: 700;
  font-feature-settings: "tnum";
}

.stat-total {
  color: var(--text-muted);
  font-size: 10.5px;
}

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

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
  background-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
}

.btn-secondary {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--accent-blue-light);
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background-color: var(--bg-surface-hover);
  color: #ffffff;
  border-color: var(--accent-blue-light);
}

.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-outline:hover {
  background: var(--bg-surface);
  color: #ffffff;
  border-color: var(--accent-gold);
}

/* ==========================================================================
   ZONE CENTRALE : FRISE CHRONOLOGIQUE À 3 LIGNES SYNCHRONISÉES
   ========================================================================== */

.timeline-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: radial-gradient(circle at 50% 25%, #182337 0%, #090d16 80%);
  overflow: hidden;
  padding: 2px 12px 4px 12px;
}

/* Axe temporel Passé -> Présent */
.timeline-axis-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 3px;
  padding: 0 10px;
}

.axis-arrow-start, .axis-arrow-end {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.axis-line-bar {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, #f59e0b, #3b82f6, #10b981);
  border-radius: var(--radius-full);
}

/* Ruban horizontal de défilement */
.timeline-scroll-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0;
  scroll-behavior: smooth;
}

/* Flèches de défilement */
.scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 64px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  font-size: 22px;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  z-index: 20;
  transition: all var(--transition-fast);
  backdrop-filter: blur(4px);
}

.scroll-arrow:hover {
  background: rgba(30, 41, 59, 0.98);
  border-color: var(--accent-blue-light);
  color: var(--accent-blue-light);
}

.scroll-left { left: 4px; }
.scroll-right { right: 4px; }

/* Piste globale des 3 lignes */
.timeline-3lines-track {
  display: flex;
  min-width: max-content;
  margin: 0 auto;
  padding: 0 44px;
  position: relative;
  gap: 12px;
  height: 100%;
}

/* Colonne des étiquettes des 3 lignes (fixe à gauche) */
.row-labels-column {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 82px;
  min-width: 82px;
  padding: 4px 0;
  gap: 6px;
  border-right: 1px dashed rgba(255, 255, 255, 0.1);
  margin-right: 6px;
}

.row-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.row-label-presidents { height: var(--president-slot-height); }
.row-label-reforms    { height: var(--reform-slot-height); }
.row-label-ministers  { height: var(--minister-card-height); }

.label-badge {
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  margin-bottom: 2px;
}

.label-title {
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
}

/* Grille dynamique des colonnes */
.timeline-dynamic-columns {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  gap: 6px;
  min-width: max-content;
  position: relative;
}

/* Zone vide initiale de la frise */
.timeline-empty-zone {
  width: 320px;
  height: 100%;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  background: rgba(30, 41, 59, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 20px;
  margin: auto;
}

.timeline-empty-zone:hover,
.timeline-empty-zone.drag-over {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.12);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.3);
  transform: scale(1.02);
}

.empty-zone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.empty-zone-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.empty-zone-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.empty-zone-sub {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* ==========================================================================
   LES 3 RANGÉES HORIZONTALES SYNCHRONISÉES
   ========================================================================== */

/* Ligne 1 : Présidents (Bannières / Chapeaux de mandat) */
.timeline-presidents-row {
  display: flex;
  align-items: center;
  height: var(--president-slot-height);
  gap: 0;
}

.president-hat-box {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 4px 8px;
  height: 100%;
  position: relative;
  transition: all var(--transition-fast);
}

.president-hat-box::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gold);
}

.president-slot-empty {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1.5px dashed rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  color: var(--accent-gold);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.president-slot-empty:hover,
.has-president-selection .president-slot-empty {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
  transform: scale(1.03);
}

/* Carte Président déposée dans le chapeau */
.president-card-placed {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1.5px solid var(--accent-gold);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  max-width: 240px;
}

.president-card-photo {
  width: 36px;
  height: 48px;
  object-fit: contain;
  object-position: center;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: #090d16;
}

.president-card-info {
  display: flex;
  flex-direction: column;
}

.president-card-name {
  font-size: 11.5px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
}

.president-card-dates {
  font-size: 9.5px;
  color: var(--accent-gold);
  font-weight: 600;
  display: none;
}

/* Ligne 2 : Réformes associées */
.timeline-reforms-row {
  display: flex;
  align-items: center;
  height: var(--reform-slot-height);
  gap: 0;
}

.reform-slot-wrap {
  width: var(--col-width);
  min-width: var(--col-width);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.reform-slot-empty {
  width: 100%;
  height: 94%;
  border: 1.5px dashed rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.05);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--accent-emerald);
  padding: 6px;
  text-align: center;
}

.reform-slot-empty .slot-icon {
  font-size: 18px;
  font-weight: 700;
}

.reform-slot-empty .slot-text {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
}

.reform-slot-empty:hover,
.has-reform-selection .reform-slot-empty {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.16);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
  transform: scale(1.03);
}

/* Carte Réforme déposée */
.reform-card-placed {
  width: 100%;
  height: 94%;
  background: linear-gradient(180deg, #162a2b 0%, #112122 100%);
  border: 1.5px solid var(--accent-emerald);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 6px 6px 6px;
  position: relative;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: all var(--transition-fast);
  overflow: hidden;
}

.reform-card-placed:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.reform-card-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.reform-card-title {
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  text-align: center;
  word-break: normal;
  hyphens: auto;
  overflow: hidden;
}

.reform-card-date {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--accent-emerald);
  margin-top: 2px;
  display: none;
}

/* Ligne 3 : Ministres */
.timeline-ministers-row {
  display: flex;
  align-items: center;
  height: var(--minister-card-height);
  gap: 0;
}

.minister-col-wrap {
  width: var(--col-width);
  min-width: var(--col-width);
  height: 100%;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Carte Ministre sur la frise */
.minister-card-placed {
  width: 100%;
  height: 98%;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--accent-blue);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-md);
  cursor: grab;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.minister-card-placed:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), 0 0 10px rgba(59, 130, 246, 0.4);
}

.card-photo-box-mini {
  width: 100%;
  height: 94px;
  background-color: #090d16;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-photo-mini {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}

.card-info-mini {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  text-align: center;
  background: var(--bg-surface);
}

.card-name-mini {
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-date-mini {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--accent-gold);
  margin-top: 1px;
  display: none;
}

/* Zone d'insertion relative [+] entre colonnes */
.insertion-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 20px;
  min-width: 20px;
  height: 100%;
  position: relative;
  cursor: pointer;
  z-index: 5;
  transition: all var(--transition-fast);
}

.insertion-bar {
  width: 2px;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
}

.insertion-btn {
  display: none;
  position: absolute;
  top: 75%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: #ffffff;
  border: 2px solid #ffffff;
  font-size: 18px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.7);
  cursor: pointer;
  pointer-events: auto;
}

/* Quand un ministre est sélectionné */
.has-minister-selection .insertion-zone {
  width: 44px;
  min-width: 44px;
}

.has-minister-selection .insertion-zone .insertion-bar {
  background: rgba(245, 158, 11, 0.4);
  width: 3px;
}

.has-minister-selection .insertion-zone .insertion-btn {
  display: flex;
  background: var(--accent-gold);
  color: #090d16;
  border-color: #ffffff;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.8);
}

.has-minister-selection .insertion-zone:hover .insertion-btn {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 0 20px rgba(245, 158, 11, 1);
}

/* Boutons d'action sur cartes posées */
.card-info-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  z-index: 5;
  transition: all var(--transition-fast);
}

.card-info-btn:hover {
  background: var(--accent-blue);
  transform: scale(1.15);
}

.card-remove-btn {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(244, 63, 94, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  z-index: 7;
  transition: all var(--transition-fast);
}

.card-remove-btn:hover {
  background: #e11d48;
  transform: scale(1.15);
}

/* Pastilles de statut de vérification */
.status-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  display: none;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  z-index: 6;
}

.status-correct {
  display: flex !important;
  background-color: var(--accent-emerald) !important;
}

.status-wrong {
  display: flex !important;
  background-color: var(--accent-rose) !important;
}

/* États de vérification finale */
.is-verified .card-date-mini,
.is-verified .reform-card-date,
.is-verified .president-card-dates {
  display: block !important;
}

/* ==========================================================================
   ZONE INFÉRIEURE : LE RACK DE CARTES (DOCK EN BAS)
   ========================================================================== */

.cards-dock-section {
  height: 180px;
  min-height: 180px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 4px 14px 6px 14px;
  position: relative;
  z-index: 20;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  box-sizing: border-box;
  transition: height var(--transition-normal);
}

/* Mode Côte à côte (Idéal écran 1920x1080 sans aucun défilement vertical) */
.cards-dock-section.layout-side {
  height: 208px;
  min-height: 208px;
}

.cards-dock-section.layout-side .dock-double-rack {
  flex-direction: row;
  gap: 12px;
}

.cards-dock-section.layout-side .dock-row-reforms-wrap {
  flex: 1.15;
  min-width: 0;
}

.cards-dock-section.layout-side .dock-row-ministers-wrap {
  flex: 0.85;
  min-width: 0;
}

/* Mode Superposé (Deux lignes empilées sur toute la largeur) */
.cards-dock-section.layout-stacked {
  height: 335px;
  min-height: 335px;
  padding: 6px 14px 8px 14px;
}

.cards-dock-section.layout-stacked .dock-double-rack {
  flex-direction: column;
  gap: 6px;
}

.cards-dock-section.layout-stacked .dock-row-rack {
  width: 100%;
  flex: 1;
}

@media (max-height: 760px) {
  .cards-dock-section.layout-stacked {
    height: 280px;
    min-height: 280px;
  }
}

.dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
  flex-shrink: 0;
}

.dock-left-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dock-title {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #ffffff;
}

.dock-badge {
  font-size: 10.5px;
  font-weight: 600;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--accent-gold);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.dock-subrow-indicators {
  display: flex;
  align-items: center;
  gap: 6px;
}

.subrow-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.tag-reform {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald);
}

.tag-minister {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: var(--accent-blue-light);
}

.dock-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Sélecteur de disposition ergonomique */
.dock-layout-group {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.dock-layout-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.dock-layout-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.dock-layout-btn.active {
  color: #ffffff;
  background: var(--accent-blue);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.4);
}

/* Double Rack horizontal (Côte à côte ou Superposé) */
.dock-double-rack {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.dock-row-rack {
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px 6px 4px 6px;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.dock-row-reforms-wrap {
  border-left: 3px solid var(--accent-emerald);
}

.dock-row-ministers-wrap {
  border-left: 3px solid var(--accent-blue);
}

.dock-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
  padding: 0 2px;
  flex-shrink: 0;
}

.dock-row-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.dock-row-label.dot-reform {
  color: var(--accent-emerald);
}

.dock-row-label.dot-minister {
  color: var(--accent-blue-light);
}

.dock-row-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dock-scroll-mini-btn {
  width: 20px;
  height: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.dock-scroll-mini-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-blue-light);
  color: var(--accent-blue-light);
}

/* Pistes de cartes défilantes - Cadres des cartes 100% visibles sans aucune coupure */
.dock-row-track {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 12px 16px 12px;
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.4) rgba(15, 23, 42, 0.5);
}

.dock-row-track::-webkit-scrollbar {
  height: 6px;
}

.dock-row-track::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 3px;
  margin: 0 8px;
}

.dock-row-track::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.4);
  border-radius: 3px;
}

.dock-row-track::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.7);
}

.dock-empty-hint {
  font-size: 11px;
  font-style: italic;
  color: var(--accent-emerald);
  padding: 4px 8px;
  margin: auto;
}

/* Format aéré des cartes dans le rack (cadres et bordures intégralement visibles) */
.dock-row-track .dock-card {
  height: 110px;
  min-height: 110px;
  max-height: 110px;
  flex-shrink: 0;
  cursor: grab;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: all var(--transition-fast);
}

/* Cartes Réformes dans le rack (Cadre émeraude net 2px, texte spacieux centré) */
.dock-row-track .dock-card-reform {
  width: 190px;
  min-width: 190px;
  background: rgba(16, 185, 129, 0.08);
  border: 2px solid rgba(16, 185, 129, 0.65);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.dock-row-track .dock-card-reform:hover {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.16);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.dock-row-track .dock-card-reform .dock-reform-text-wrap {
  padding: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.dock-row-track .dock-card-reform .dock-reform-title {
  font-size: 11px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: center;
  word-break: normal;
}

/* Cartes Ministres dans le rack (Cadre bleu net 2px, photo nette + nom complet) */
.dock-row-track .dock-card-minister {
  width: 104px;
  min-width: 104px;
  max-width: 104px;
  background: var(--bg-surface);
  border: 2px solid rgba(59, 130, 246, 0.65);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.dock-row-track .dock-card-minister:hover {
  border-color: var(--accent-blue-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
}

.dock-row-track .dock-card-minister .card-photo-wrap {
  width: 100%;
  height: 68px;
  min-height: 68px;
  max-height: 68px;
  background-color: #070b14;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.dock-row-track .dock-card-minister .card-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 2px;
}

.dock-row-track .dock-card-minister .card-name {
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  padding: 2px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.15;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: normal;
  background: var(--bg-surface);
  flex-shrink: 0;
}

.dock-row-track .card-badge-type {
  display: none;
}

.dock-row-track .card-info-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  background: rgba(0, 0, 0, 0.75);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all var(--transition-fast);
}

.dock-row-track .card-info-btn:hover {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: #ffffff;
}

.dock-row-track .card-badge-type {
  display: none;
}

.dock-row-track .card-info-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  background: rgba(0, 0, 0, 0.75);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all var(--transition-fast);
}

.dock-row-track .card-info-btn:hover {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: #ffffff;
}

.dock-row-track .card-info-btn:hover {
  background: var(--accent-blue);
  color: #ffffff;
}

/* Réforme dans la pioche : 100% texte, pas d'icône ni d'image */
.dock-reform-text-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 10px 12px 10px;
}

.dock-reform-title {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  text-align: center;
  word-break: normal;
  hyphens: auto;
}

.card-badge-type {
  position: absolute;
  top: 3px;
  left: 3px;
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  z-index: 6;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-minister { background: rgba(37, 99, 235, 0.85); color: #ffffff; }
.badge-president { background: rgba(245, 158, 11, 0.9); color: #090d16; font-weight: 900; }
.badge-reform   { background: rgba(16, 185, 129, 0.85); color: #ffffff; }

/* Barre d'aide et bandeau de vérification / correction non-bloquant */
.timeline-helper-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  min-height: 38px;
  gap: 12px;
}

.timeline-helper-bar.has-verification-hud {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 16px rgba(15, 23, 42, 0.6);
}

.helper-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  line-height: 1.3;
}

.helper-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-blue-light);
  flex-shrink: 0;
}

/* Bandeau HUD de vérification avec bouton Peek interactif */
.verification-hud {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.verification-hud.hidden {
  display: none !important;
}

.hud-score-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-score-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.hud-score-min {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: var(--accent-blue-light);
}

.hud-score-ref {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald);
}

.hud-score-summary {
  font-size: 11px;
  color: #e2e8f0;
  margin-left: 2px;
}

/* Bouton interactif Peek Correction */
.btn-peek-correction {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1.5px solid var(--accent-gold);
  color: #ffffff;
  padding: 5px 14px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

.btn-peek-correction svg {
  color: var(--accent-gold);
}

.btn-peek-correction:hover {
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
  border-color: #fbbf24;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.5);
}

.btn-peek-correction.is-peeking,
.btn-peek-correction:active {
  background: var(--accent-gold);
  color: #090d16;
  border-color: #ffffff;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.9);
  transform: scale(0.97);
}

.btn-peek-correction.is-peeking svg,
.btn-peek-correction:active svg {
  color: #090d16;
}

/* Statut spécial lorsque la correction est affichée en mode Peek */
.status-correction-peek {
  outline: 2px dashed var(--accent-gold) !important;
  border-color: var(--accent-gold) !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6) !important;
}

/* ==========================================================================
   MODALES (FICHE BIO/RÉFORME & RÉSULTATS)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 660px;
  width: 100%;
  position: relative;
  overflow: hidden;
  animation: modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.modal-content {
  display: flex;
  gap: 22px;
  padding: 26px;
}

.modal-photo-wrap {
  width: 160px;
  min-width: 160px;
  position: relative;
}

.modal-photo-wrap img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-medium);
  background-color: #090d16;
}

.modal-reform-icon {
  width: 100%;
  height: 210px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.2), #0f172a 80%);
}

.modal-reform-icon svg {
  width: 64px;
  height: 64px;
  color: var(--accent-emerald);
}

.modal-type-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: var(--accent-blue);
  color: #ffffff;
  font-weight: 800;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-details {
  flex: 1;
}

.modal-details h2 {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
}

.modal-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.modal-meta-row strong {
  color: var(--accent-gold);
}

.meta-separator {
  color: var(--text-muted);
}

.meta-highlight {
  color: var(--accent-blue-light);
  font-weight: 600;
}

.modal-gov-row {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.modal-gov-row .meta-label {
  font-weight: 600;
  color: var(--text-muted);
}

.modal-section {
  margin-bottom: 12px;
}

.modal-section h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.modal-section p {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-primary);
}

.modal-quote-wrap blockquote {
  font-style: italic;
  font-size: 12px;
  color: #cbd5e1;
  border-left: 3px solid var(--accent-gold);
  padding-left: 10px;
}

/* Modale Bilan / Résultats */
.modal-result-card {
  text-align: center;
  padding: 34px 30px;
  max-width: 540px;
}

.result-icon-wrap {
  font-size: 46px;
  margin-bottom: 8px;
}

.modal-result-card h2 {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
}

.result-subtitle {
  color: var(--text-secondary);
  font-size: 12.5px;
  margin-bottom: 18px;
}

.result-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.stat-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 6px;
}

.stat-box.highlight {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.08);
}

.stat-number {
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  font-feature-settings: "tnum";
}

.stat-box.highlight .stat-number {
  color: var(--accent-emerald);
}

.stat-desc {
  font-size: 10.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.result-feedback {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.45;
  color: #e2e8f0;
  margin-bottom: 22px;
  text-align: left;
}

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

/* Modale des Règles */
.modal-rules-card {
  padding: 28px;
  max-width: 620px;
}

.modal-rules-card h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
  color: #ffffff;
}

.rules-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.rule-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.rule-num {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.rule-text {
  font-size: 12px;
  line-height: 1.45;
  color: #cbd5e1;
}

.rule-text strong {
  color: #ffffff;
}

.rules-footer {
  display: flex;
  justify-content: flex-end;
}

/* Canvas confettis */
.confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
}

/* Overlay paysage */
.landscape-warning {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.warning-box {
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.rotate-icon {
  color: var(--accent-gold);
  animation: rotate-anim 2s infinite ease-in-out;
}

@keyframes rotate-anim {
  0%, 20% { transform: rotate(0deg); }
  60%, 100% { transform: rotate(90deg); }
}

@media (orientation: portrait) and (max-width: 800px) {
  .landscape-warning {
    display: flex;
  }
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   PLATEAU 6 LIGNES SYNCHRONISÉES (2 ÈRES x 3 LIGNES)
   ========================================================================== */

.timeline-6lines-board {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: calc(100% - 16px);
  max-width: 1880px;
  margin: 0 auto;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  justify-content: center;
  box-sizing: border-box;
}

.era-block {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2px 6px 3px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}

.era-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1px 4px 2px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.era-tag {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-blue-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.era-tag::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-blue);
  box-shadow: 0 0 6px var(--accent-blue);
}

.era-sub {
  font-size: 9.5px;
  color: var(--text-muted);
}

/* Grille synchronisée */
.era-grid-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

/* Ligne des Présidents (Ligne 1 & Ligne 4) */
.era-row-presidents {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 4px;
  height: 28px;
}

.pres-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pres-banner:hover {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, rgba(37, 50, 72, 0.95) 0%, rgba(19, 29, 52, 0.98) 100%);
  transform: translateY(-1px);
}

.pres-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent-gold);
}

.pres-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--accent-gold);
  flex-shrink: 0;
  background: #090d16;
}

.pres-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  overflow: hidden;
  white-space: nowrap;
}

.pres-name {
  font-size: 10.5px;
  font-weight: 700;
  color: #ffffff;
  text-overflow: ellipsis;
  overflow: hidden;
}

.pres-dates {
  font-size: 9px;
  color: var(--accent-gold);
  font-weight: 600;
}

/* Ligne des Réformes (Ligne 2 & Ligne 5) */
.era-row-reforms {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 4px;
  min-height: 50px;
  align-items: stretch;
}

.reform-column-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100%;
}

.reform-slot-empty {
  flex: 1;
  border: 1.5px dashed rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 3px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: rgba(16, 185, 129, 0.8);
  font-size: 8.5px;
  font-weight: 600;
  min-height: 48px;
}

.reform-slot-empty:hover,
.reform-slot-empty.drag-over {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.15);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.reform-slot-none {
  flex: 1;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 8.5px;
  background: rgba(15, 23, 42, 0.2);
  min-height: 48px;
}

.reform-card-placed {
  flex: 1;
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid var(--accent-emerald);
  border-radius: var(--radius-sm);
  padding: 2px 3px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  min-height: 48px;
  overflow: hidden;
}

.reform-card-placed:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
  border-color: #34d399;
}

.reform-card-placed.is-selected {
  outline: 2px solid var(--accent-gold);
  box-shadow: 0 0 12px var(--accent-gold-glow);
}

.reform-card-title {
  font-size: 9px;
  font-weight: 600;
  line-height: 1.15;
  color: #f1f5f9;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: auto 0;
  pointer-events: none;
}

.reform-card-date {
  font-size: 8px;
  font-weight: 700;
  color: #34d399;
  text-align: center;
  margin-top: 1px;
}

/* Ligne des Ministres (Ligne 3 & Ligne 6) */
.era-row-ministers {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 4px;
  height: 104px;
}

.minister-slot {
  height: 100%;
  border-radius: var(--radius-sm);
  position: relative;
}

.minister-slot-empty {
  height: 100%;
  border: 1.5px dashed rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 6px 2px;
  text-align: center;
  gap: 4px;
}

.minister-slot-empty:hover,
.minister-slot-empty.drag-over {
  border-color: var(--accent-blue-light);
  background: rgba(59, 130, 246, 0.16);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.35);
}

.slot-num-badge {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-blue-light);
  background: rgba(59, 130, 246, 0.2);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.slot-sub-text {
  font-size: 9.5px;
  color: var(--text-muted);
}

.card-minister-placed {
  height: 100%;
  background: var(--bg-surface);
  border: 1.5px solid rgba(59, 130, 246, 0.5);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  cursor: grab;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.card-minister-placed:hover {
  transform: translateY(-2px);
  border-color: var(--accent-blue-light);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.card-minister-placed.is-selected {
  outline: 2px solid var(--accent-gold);
  border-color: var(--accent-gold);
  box-shadow: 0 0 14px var(--accent-gold-glow);
}

.minister-photo-wrap {
  height: 64px;
  width: 100%;
  background: #070b14;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.minister-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #070b14;
  display: block;
  padding: 2px;
}

.minister-card-body {
  padding: 3px 2px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  text-align: center;
}

.minister-card-name {
  font-size: 9.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  word-break: normal;
}

.minister-card-date {
  font-size: 8.5px;
  font-weight: 600;
  color: var(--accent-blue-light);
  line-height: 1;
  margin-top: 1px;
}

/* Boutons d'action sur carte posée */
.card-remove-btn {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: rgba(0, 0, 0, 0.75);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.5);
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all var(--transition-fast);
}

.card-remove-btn:hover {
  background: #f43f5e;
  color: #ffffff;
}

.card-info-btn-placed {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  background: rgba(0, 0, 0, 0.75);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-size: 10px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all var(--transition-fast);
}

.card-info-btn-placed:hover {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
}

/* Statuts de vérification */
.status-correct {
  border-color: var(--accent-emerald) !important;
  box-shadow: 0 0 10px var(--accent-emerald-glow) !important;
}

.status-correct::after {
  content: '✓';
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: var(--accent-emerald);
  color: #ffffff;
  font-size: 9px;
  font-weight: 900;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
}

.status-wrong {
  border-color: var(--accent-rose) !important;
  box-shadow: 0 0 10px var(--accent-rose-glow) !important;
  animation: shake 0.4s ease;
}

.status-wrong::after {
  content: '✕';
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: var(--accent-rose);
  color: #ffffff;
  font-size: 9px;
  font-weight: 900;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
}

