/* ================================================================
   SIMULATEUR DE SOLIDIFICATION DE L'EAU
   styles.css – Feuille de style principale
   Auteur : Simulateur Pédagogique Physique·Chimie
   ================================================================ */

/* ----------------------------------------------------------------
   1. VARIABLES CSS & TOKENS DE DESIGN
   ---------------------------------------------------------------- */
:root {
  /* Palette principale (thème froid / science) */
  --clr-bg:           #060d1a;
  --clr-bg-2:         #0a1628;
  --clr-surface:      #0f1f38;
  --clr-surface-2:    #152540;
  --clr-border:       rgba(100, 180, 255, 0.15);
  --clr-border-hover: rgba(100, 180, 255, 0.4);

  /* Accents */
  --clr-accent:       #00c6ff;
  --clr-accent-2:     #0072ff;
  --clr-ice:          #a8d8f0;
  --clr-water:        #3498db;
  --clr-freeze:       #00d4ff;
  --clr-danger:       #ff4757;
  --clr-success:      #2ed573;

  /* Dégradé principal */
  --grad-main:        linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
  --grad-ice:         linear-gradient(180deg, #dff3ff, #a8d8f0);
  --grad-card:        linear-gradient(145deg, #0f1f38, #152540);

  /* Texte */
  --clr-text:         #e8f4fd;
  --clr-text-muted:   #7ba5c8;
  --clr-text-dim:     #4a7a9b;

  /* Typographie */
  --font-main:        'Inter', system-ui, sans-serif;
  --font-mono:        'JetBrains Mono', 'Courier New', monospace;
  --font-display:     'Orbitron', sans-serif;

  /* Espacements */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;

  /* Bordures */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Ombres */
  --shadow-card:  0 8px 32px rgba(0, 30, 60, 0.6), 0 2px 8px rgba(0,198,255,0.05);
  --shadow-glow:  0 0 20px rgba(0, 198, 255, 0.25);
  --shadow-btn:   0 4px 15px rgba(0, 114, 255, 0.4);

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow:   0.6s ease;
}

/* ----------------------------------------------------------------
   2. RESET & BASE
   ---------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background-color: var(--clr-bg);
  color: var(--clr-text);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(0,114,255,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(0,198,255,0.08) 0%, transparent 60%);
  background-attachment: fixed;
}

img, svg { display: block; max-width: 100%; }

button { cursor: pointer; font-family: var(--font-main); }

input[type="range"] { cursor: pointer; }

/* ----------------------------------------------------------------
   3. HEADER
   ---------------------------------------------------------------- */
.app-header {
  background: rgba(10, 22, 40, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--clr-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.logo-icon {
  font-size: 2rem;
  animation: float 4s ease-in-out infinite;
}

.logo-text h1 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--grad-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.02em;
}

.header-subtitle {
  font-size: 0.72rem;
  color: var(--clr-text-muted);
  margin-top: 2px;
  letter-spacing: 0.04em;
}

.header-badge {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: rgba(0,198,255,0.1);
  border: 1px solid rgba(0,198,255,0.25);
  border-radius: 100px;
  padding: var(--space-xs) var(--space-md);
  font-size: 0.8rem;
  color: var(--clr-accent);
  font-weight: 500;
}

/* ----------------------------------------------------------------
   4. LAYOUT PRINCIPAL
   ---------------------------------------------------------------- */
.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* ----------------------------------------------------------------
   5. CARTES (CARDS)
   ---------------------------------------------------------------- */
.card {
  background: var(--grad-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
  border-color: var(--clr-border-hover);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--clr-border);
  background: rgba(0,0,0,0.15);
  flex-wrap: wrap;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--clr-text);
  flex: 1;
}

.card-body {
  padding: var(--space-xl);
}

.step-badge {
  background: var(--grad-main);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 100px;
  text-transform: uppercase;
}

/* ----------------------------------------------------------------
   6. PARAMÈTRES
   ---------------------------------------------------------------- */
.instruction-text {
  font-size: 0.9rem;
  color: var(--clr-text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-lg);
  background: rgba(0,198,255,0.05);
  border-left: 3px solid var(--clr-accent);
  padding: var(--space-sm) var(--space-md);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.param-group {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: border-color var(--transition-fast);
}

.param-group:hover {
  border-color: rgba(0,198,255,0.35);
}

.param-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--clr-text);
  margin-bottom: var(--space-md);
}

.param-hint {
  font-size: 0.75rem;
  color: var(--clr-text-dim);
  font-weight: 400;
}

.param-input-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Slider personnalisé */
.param-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(100,180,255,0.2);
  outline: none;
  transition: background var(--transition-fast);
}

.param-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--grad-main);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,114,255,0.5);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.param-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 12px rgba(0,198,255,0.7);
}

.param-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--grad-main);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(0,114,255,0.5);
}

.param-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--clr-accent);
  min-width: 60px;
  text-align: right;
}

/* ----------------------------------------------------------------
   7. BOUTONS
   ---------------------------------------------------------------- */
.controls-row {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-md);
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition-fast);
}

.btn:hover::before { background: rgba(255,255,255,0.06); }

.btn:active { transform: scale(0.97); }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--grad-main);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.btn-secondary {
  background: rgba(100,180,255,0.12);
  color: var(--clr-accent);
  border: 1px solid rgba(100,180,255,0.3);
}

.btn-danger {
  background: rgba(255,71,87,0.12);
  color: var(--clr-danger);
  border: 1px solid rgba(255,71,87,0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--clr-text-muted);
  border: 1px solid var(--clr-border);
  font-size: 0.8rem;
}

.btn-ghost:hover { color: var(--clr-accent); border-color: rgba(0,198,255,0.35); }

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.78rem; }

.btn-icon { font-style: normal; }

/* Bouton d'action orange/chaud et animation */
.btn-warning {
  background: linear-gradient(135deg, #f5a623 0%, #ff6b35 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.btn-warning:hover {
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.65);
}

@keyframes pulse-orange {
  0% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(255, 107, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0); }
}

.btn-pulse {
  animation: pulse-orange 1.5s infinite;
}

/* ----------------------------------------------------------------
   8. SECTION OBSERVATION (thermomètre + tube)
   ---------------------------------------------------------------- */
.observation-section {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-xl);
}

/* ---- 8a. Thermomètre ---- */
.thermo-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
}

/* Affichage numérique */
.thermo-digital {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--clr-accent);
  text-shadow: 0 0 20px rgba(0,198,255,0.5);
  display: flex;
  align-items: baseline;
  gap: 4px;
  transition: color var(--transition-normal);
  min-width: 160px;
  justify-content: center;
}

.thermo-unit {
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--clr-text-muted);
}

/* Thermomètre graphique */
.thermo-graphic-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

.thermo-graphic {
  display: flex;
  align-items: flex-end;
  gap: var(--space-md);
  height: 250px;
}

.thermo-scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 210px;
  align-items: flex-end;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--clr-text-dim);
  padding-bottom: 4px;
}

.scale-label {
  line-height: 1;
  white-space: nowrap;
  padding-right: 4px;
  transition: color var(--transition-normal);
}

.thermo-tube {
  width: 28px;
  height: 210px;
  border-radius: 14px 14px 0 0;
  border: 2px solid rgba(100,200,255,0.5);
  background: rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.thermo-fill {
  width: 100%;
  height: 60%;
  background: linear-gradient(180deg, var(--clr-water), #1a5fa8);
  border-radius: 0 0 12px 12px;
  transition: height 0.5s ease, background var(--transition-normal);
}

.thermo-bulb {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--clr-water) 40%, #1a5fa8 100%);
  border: 2px solid rgba(100,200,255,0.5);
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  transition: background var(--transition-normal);
  box-shadow: 0 0 12px rgba(52,152,219,0.4);
}

/* Indicateur de phase */
.phase-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.82rem;
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  border-radius: 100px;
  border: 1px solid var(--clr-border);
  background: rgba(0,0,0,0.2);
  transition: all var(--transition-normal);
}

.phase-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--clr-text-dim);
  transition: background var(--transition-normal);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; }
  50% { box-shadow: 0 0 0 5px transparent; }
}

/* ---- 8b. Tube à essai ---- */
.tube-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.freezer-scene {
  flex: 1;
}

.freezer-bg {
  background: radial-gradient(ellipse at 30% 20%, #1a3a5c, #0a1f33);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  min-height: 320px;
  position: relative;
  border: 1px solid rgba(100,180,255,0.15);
  overflow: hidden;
}

.freezer-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 30px,
    rgba(100,180,255,0.02) 30px,
    rgba(100,180,255,0.02) 31px
  );
}

/* Version température ambiante de la pièce */
.freezer-bg.freezer-bg--room {
  background: radial-gradient(ellipse at 30% 20%, #4a2715, #1e0e07);
  border-color: rgba(255, 120, 60, 0.25);
  box-shadow: 0 8px 32px rgba(60, 30, 0, 0.5), 0 2px 8px rgba(255, 107, 53, 0.05);
}

.freezer-bg.freezer-bg--room::before {
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 30px,
    rgba(255, 120, 60, 0.02) 30px,
    rgba(255, 120, 60, 0.02) 31px
  );
}

.freezer-bg.freezer-bg--room .freezer-temp-display {
  color: #ffab80;
  border-color: rgba(255, 171, 128, 0.25);
  box-shadow: 0 0 12px rgba(255, 107, 53, 0.15);
}

.freezer-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-text-dim);
  font-weight: 600;
  align-self: flex-start;
}

.freezer-temp-display {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--clr-ice);
  background: rgba(0,0,0,0.3);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(168,216,240,0.2);
}

.tube-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  z-index: 1;
}

.tube-svg {
  width: 120px;
  height: 340px;
  filter: drop-shadow(0 0 15px rgba(0,198,255,0.25));
}

.tube-legend {
  display: flex;
  gap: var(--space-md);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--clr-text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.water-dot { background: #3498db; }
.ice-dot   { background: #a8d8f0; }

/* Flocons de neige */
.snowflakes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -20px;
  font-size: 0.9rem;
  opacity: 0;
  animation: snow-fall linear infinite;
  color: rgba(168, 216, 240, 0.6);
  user-select: none;
}

@keyframes snow-fall {
  0%   { transform: translateY(-20px) rotate(0deg);   opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(320px) rotate(360deg); opacity: 0; }
}

/* ---- Chronomètre ---- */
.chronometer {
  text-align: center;
  padding: var(--space-md);
  border-top: 1px solid var(--clr-border);
}

.chrono-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--clr-text-dim);
  margin-bottom: var(--space-sm);
}

.chrono-display {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--clr-accent);
  letter-spacing: 0.05em;
  text-shadow: 0 0 15px rgba(0,198,255,0.4);
}

.chrono-sub {
  font-size: 0.7rem;
  color: var(--clr-text-dim);
  margin-top: 4px;
}

/* ----------------------------------------------------------------
   9. GRAPHIQUE
   ---------------------------------------------------------------- */
.chart-card .card-header {
  flex-wrap: wrap;
}

.chart-actions {
  margin-left: auto;
}

.chart-container {
  height: 380px;
  position: relative;
}

/* Annotations de phases */
.phase-annotations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.annotation {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-md);
  border: 1px solid var(--clr-border);
  font-size: 0.82rem;
}

.annotation-color {
  width: 4px;
  min-width: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}

.annotation strong {
  display: block;
  color: var(--clr-text);
  margin-bottom: 4px;
  font-size: 0.85rem;
}

.annotation p {
  color: var(--clr-text-muted);
  line-height: 1.5;
}

/* ----------------------------------------------------------------
   10. TABLEAU DE DONNÉES
   ---------------------------------------------------------------- */
.table-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--clr-text-muted);
  background: rgba(0,0,0,0.3);
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid var(--clr-border);
}

.table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 320px;       /* hauteur fixe : le tableau défile en interne */
  border-radius: var(--radius-md);
  border: 1px solid var(--clr-border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table thead tr {
  background: rgba(0,198,255,0.08);
  border-bottom: 1px solid var(--clr-border);
}

/* En-tête collant lors du scroll interne du tableau */
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #111f38;   /* doit être opaque pour masquer les lignes sous */
}

.data-table th {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--clr-text-muted);
  font-weight: 600;
}

.data-table tbody tr {
  border-bottom: 1px solid rgba(100,180,255,0.08);
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover { background: rgba(0,198,255,0.05); }

.data-table tbody tr:last-child { border-bottom: none; }

.data-table td {
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.83rem;
  color: var(--clr-text);
}

.data-table td:first-child {
  color: var(--clr-text-dim);
}

.empty-row td {
  text-align: center;
  color: var(--clr-text-dim);
  font-family: var(--font-main);
  padding: var(--space-xl);
  font-style: italic;
}

/* Badges de phase dans le tableau */
.phase-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-family: var(--font-main);
  font-weight: 600;
}

.phase-badge.liquid {
  background: rgba(52,152,219,0.2);
  color: var(--clr-water);
  border: 1px solid rgba(52,152,219,0.3);
}

.phase-badge.plateau {
  background: rgba(0,212,255,0.2);
  color: var(--clr-freeze);
  border: 1px solid rgba(0,212,255,0.3);
}

.phase-badge.ice {
  background: rgba(168,216,240,0.15);
  color: var(--clr-ice);
  border: 1px solid rgba(168,216,240,0.25);
}

.phase-badge.warming_ice {
  background: rgba(136, 187, 221, 0.15);
  color: #88bbdd;
  border: 1px solid rgba(136, 187, 221, 0.25);
}

.phase-badge.melting {
  background: rgba(245, 166, 35, 0.15);
  color: #f5a623;
  border: 1px solid rgba(245, 166, 35, 0.25);
}

.phase-badge.warming_water {
  background: rgba(255, 107, 53, 0.15);
  color: #ff6b35;
  border: 1px solid rgba(255, 107, 53, 0.25);
}

.phase-badge.done_all {
  background: rgba(46, 213, 115, 0.15);
  color: #2ed573;
  border: 1px solid rgba(46, 213, 115, 0.25);
}

/* ----------------------------------------------------------------
   11. SECTION ANALYSE
   ---------------------------------------------------------------- */
.analysis-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.summary-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

.summary-item:hover { border-color: var(--clr-border-hover); }

.summary-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.summary-label {
  font-size: 0.75rem;
  color: var(--clr-text-muted);
  margin-bottom: 4px;
}

.summary-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--clr-accent);
  font-weight: 700;
}

/* Quiz */
.quiz-section {
  margin-bottom: var(--space-xl);
}

.quiz-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--clr-text);
  margin-bottom: var(--space-md);
}

.quiz-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.quiz-item {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.quiz-question {
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: var(--space-sm);
  color: var(--clr-text);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.83rem;
  color: var(--clr-text-muted);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  width: 100%;
}

.quiz-option:hover {
  background: rgba(0,198,255,0.08);
  border-color: rgba(0,198,255,0.2);
  color: var(--clr-text);
}

.quiz-option.correct {
  background: rgba(46,213,115,0.12);
  border-color: rgba(46,213,115,0.3);
  color: var(--clr-success);
}

.quiz-option.wrong {
  background: rgba(255,71,87,0.1);
  border-color: rgba(255,71,87,0.25);
  color: var(--clr-danger);
}

.quiz-feedback {
  font-size: 0.8rem;
  margin-top: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  display: none;
}

.quiz-feedback.show { display: block; }
.quiz-feedback.correct-fb { color: var(--clr-success); background: rgba(46,213,115,0.08); }
.quiz-feedback.wrong-fb   { color: var(--clr-danger);  background: rgba(255,71,87,0.08); }

/* Notion clé */
.key-notion {
  background: linear-gradient(135deg, rgba(0,114,255,0.1), rgba(0,198,255,0.05));
  border: 1px solid rgba(0,198,255,0.2);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.notion-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--clr-accent);
  margin-bottom: var(--space-md);
}

.notion-content {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--clr-text-muted);
}

.notion-content p + p { margin-top: var(--space-md); }

.notion-content strong { color: var(--clr-text); }

/* ----------------------------------------------------------------
   12. FOOTER
   ---------------------------------------------------------------- */
.app-footer {
  text-align: center;
  padding: var(--space-xl);
  border-top: 1px solid var(--clr-border);
  margin-top: var(--space-xl);
}

.app-footer p {
  font-size: 0.82rem;
  color: var(--clr-text-dim);
}

.footer-sub {
  font-size: 0.72rem !important;
  margin-top: 4px;
}

/* ----------------------------------------------------------------
   13. OVERLAY DE FIN
   ---------------------------------------------------------------- */
.end-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,13,26,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.end-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.end-card {
  background: var(--grad-card);
  border: 1px solid rgba(0,198,255,0.3);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  max-width: 440px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 60px rgba(0,198,255,0.2);
  animation: card-in 0.4s ease;
}

@keyframes card-in {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.end-icon { font-size: 3rem; margin-bottom: var(--space-md); }

.end-card h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--clr-accent);
  margin-bottom: var(--space-md);
}

.end-card p {
  font-size: 0.9rem;
  color: var(--clr-text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-xl);
}

/* ----------------------------------------------------------------
   14. ANIMATIONS
   ---------------------------------------------------------------- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* Entrée des cartes */
.card {
  animation: slide-up 0.5s ease both;
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Délais d'apparition */
.setup-card        { animation-delay: 0.05s; }
.observation-section .thermo-card { animation-delay: 0.1s; }
.observation-section .tube-card   { animation-delay: 0.15s; }
.chart-card        { animation-delay: 0.2s; }
.table-card        { animation-delay: 0.25s; }
.analysis-card     { animation-delay: 0.3s; }

/* Glace scintillante */
@keyframes ice-shimmer {
  0%   { opacity: 0.85; }
  50%  { opacity: 1; }
  100% { opacity: 0.85; }
}

/* ----------------------------------------------------------------
   15. RESPONSIVE
   ---------------------------------------------------------------- */
@media (max-width: 900px) {
  .observation-section {
    grid-template-columns: 1fr;
  }

  .thermo-body {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .thermo-digital { font-size: 2rem; }
}

@media (max-width: 640px) {
  .app-main { padding: var(--space-md); gap: var(--space-md); }
  .card-body { padding: var(--space-md); }
  .card-header { padding: var(--space-md); }
  .header-inner { padding: var(--space-md); }
  .logo-text h1 { font-size: 0.95rem; }
  .header-subtitle { display: none; }
  .params-grid { grid-template-columns: 1fr; }
  .controls-row { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .phase-annotations { grid-template-columns: 1fr; }
  .analysis-summary { grid-template-columns: 1fr 1fr; }
  .chart-container { height: 260px; }
  .chrono-display { font-size: 1.8rem; }
  .thermo-digital { font-size: 2rem; }
}

@media (max-width: 400px) {
  .analysis-summary { grid-template-columns: 1fr; }
}
