:root {
  --navy: #14213D;
  --navy-deep: #0B1526;
  --white: #FFFFFF;
  --paper: #F6F7F9;
  --grey: #6B7280;
  --grey-line: #E2E5EA;
  --copper: #B08D57;
  --copper-light: #FCE7C8;
  --green: #0F766E;
  --green-light: #E6F4F2;
  --red: #B3261E;
  --red-light: #FBEAE9;
}

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

body {
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--paper);
  color: var(--navy);
  line-height: 1.6;
}

/* ---------- Topbar ---------- */

.topbar {
  background: var(--navy);
  color: var(--white);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  letter-spacing: 0.5px;
}
.brand {
  font-weight: bold;
  letter-spacing: 2px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.team-name {
  color: var(--copper-light);
}
.logout-link {
  color: #9CA7BE;
  text-decoration: none;
  border: 1px solid #2C3A5C;
  padding: 6px 12px;
  border-radius: 3px;
  transition: all 0.15s ease;
}
.logout-link:hover {
  color: var(--white);
  border-color: var(--copper);
}

/* ---------- Layout général ---------- */

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.page-narrow {
  max-width: 620px;
}

.card {
  background: var(--white);
  border: 1px solid var(--grey-line);
  border-radius: 3px;
  padding: 28px 32px;
  margin-bottom: 24px;
}

/* ---------- Boutons ---------- */

.btn-primary {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  border: none;
  padding: 13px 24px;
  font-family: Georgia, serif;
  font-size: 15px;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s ease;
}
.btn-primary:hover { background: #1E2E52; }
.btn-block { display: block; width: 100%; }

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
  padding: 8px 18px;
  font-family: Georgia, serif;
  font-size: 14px;
  border-radius: 3px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn-secondary:hover { background: var(--navy); color: var(--white); }

/* ---------- Alertes ---------- */

.alert {
  padding: 14px 18px;
  border-radius: 3px;
  font-size: 14.5px;
  margin-bottom: 20px;
}
.alert-error {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid #F0C6C3;
}
.alert-success {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid #BFE3DF;
}

/* ---------- Login ---------- */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-deep);
  background-image: radial-gradient(circle at 50% 0%, #1A2947 0%, #0B1526 70%);
}
.login-wrap {
  width: 100%;
  padding: 20px;
}
.login-card {
  max-width: 420px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 4px;
  padding: 44px 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.login-eyebrow {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--copper);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.login-title {
  font-size: 28px;
  font-weight: normal;
  color: var(--navy);
  margin-bottom: 10px;
}
.login-subtitle {
  font-size: 14.5px;
  color: var(--grey);
  margin-bottom: 26px;
}
.login-form label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: var(--navy);
  margin-bottom: 6px;
  margin-top: 16px;
}
.login-form label:first-child { margin-top: 0; }
.login-form input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--grey-line);
  border-radius: 3px;
  font-family: Georgia, serif;
  font-size: 15px;
  color: var(--navy);
}
.login-form input:focus {
  outline: none;
  border-color: var(--copper);
}
.login-form .btn-primary {
  margin-top: 24px;
  width: 100%;
}

/* ---------- Progress banner ---------- */

.progress-banner {
  margin-bottom: 28px;
}
.progress-banner-text {
  font-size: 15px;
  color: var(--navy);
  margin-bottom: 10px;
}
.progress-bar-track {
  height: 8px;
  background: var(--grey-line);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--copper);
  transition: width 0.3s ease;
}

/* ---------- Liste des énigmes ---------- */

.enigme-list {
  list-style: none;
}
.enigme-item {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--white);
  border: 1px solid var(--grey-line);
  border-radius: 3px;
  padding: 18px 22px;
  margin-bottom: 12px;
}
.enigme-item.is-locked {
  background: var(--paper);
  opacity: 0.65;
}
.enigme-item.is-solved {
  border-color: #BFE3DF;
}

.enigme-number {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 14px;
  flex-shrink: 0;
}
.enigme-item.is-locked .enigme-number {
  background: var(--grey-line);
  color: var(--grey);
}
.enigme-item.is-solved .enigme-number {
  background: var(--green);
}

.enigme-info { flex: 1; }
.enigme-title { font-size: 16px; color: var(--navy); }
.locked-title { color: var(--grey); font-style: italic; }
.enigme-state {
  font-family: 'Courier New', monospace;
  font-size: 11.5px;
  color: var(--grey);
  letter-spacing: 0.5px;
  margin-top: 3px;
  text-transform: uppercase;
}

.check-mark {
  color: var(--green);
  font-size: 20px;
}
.lock-icon {
  opacity: 0.5;
}

/* ---------- Page énigme ---------- */

.back-link {
  display: inline-block;
  color: var(--grey);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 18px;
}
.back-link:hover { color: var(--navy); }

.enigme-page-title {
  font-size: 26px;
  font-weight: normal;
  margin-bottom: 20px;
}

.enigme-enonce {
  font-size: 16px;
  color: #3A4258;
}

.enigme-indice-discret {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--grey-line);
  font-size: 12px;
  font-style: italic;
  color: var(--grey);
  letter-spacing: 0.5px;
}

.enigme-visuel {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.crossword-svg {
  max-width: 100%;
  height: auto;
}

.enigme-audio {
  margin-top: 18px;
  padding: 16px;
  background: var(--paper);
  border-radius: 6px;
  display: flex;
  justify-content: center;
}
.enigme-audio audio {
  width: 100%;
  max-width: 420px;
}

/* ---------- Grille de mots croisés interactive ---------- */

.crossword-grid {
  display: grid;
  grid-auto-rows: 44px;
  gap: 2px;
  width: max-content;
  margin: 0 auto 16px;
}

.crossword-cell {
  position: relative;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  max-width: 44px;
  max-height: 44px;
  display: block;
  background: white;
  border: 1px solid var(--navy);
  box-sizing: border-box;
}

.crossword-cell-empty {
  background: transparent;
  border: none;
}

.crossword-cell-reveal {
  background: var(--copper-light);
  border-color: var(--copper);
  color: #8A6524;
}

.crossword-cell-letter {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  font-size: 20px;
  color: #14213D;
}
.crossword-cell-reveal .crossword-cell-letter {
  color: #8A6524;
}

.crossword-cell-number {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 10px;
  font-weight: bold;
  color: var(--copper);
  line-height: 1;
  pointer-events: none;
  z-index: 1;
}

.crossword-input {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  box-sizing: border-box;
  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  font-size: 20px;
  text-transform: uppercase;
  color: #14213D;
  background: transparent;
}
.crossword-input:focus {
  outline: 2px solid var(--copper);
  outline-offset: -2px;
}

.crossword-reveal-hint {
  font-size: 14px;
  color: var(--grey);
  text-align: center;
  margin-bottom: 14px;
}

/* ---------- Définitions en deux colonnes (horizontal / vertical) ---------- */

.crossword-definitions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--grey-line);
}

.crossword-def-column h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--copper);
  margin-bottom: 8px;
  font-weight: bold;
}

.crossword-def-item {
  font-size: 13.5px;
  color: #3A4258;
  margin-bottom: 8px;
  line-height: 1.4;
}

.crossword-def-item strong {
  color: var(--navy);
  font-family: 'Courier New', monospace;
}

@media (max-width: 480px) {
  .crossword-definitions {
    grid-template-columns: 1fr;
    gap: 14px 0;
  }
}

.enigme-form label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: var(--navy);
  margin-bottom: 8px;
}
.enigme-form input[type="text"],
.enigme-form input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--grey-line);
  border-radius: 3px;
  font-family: Georgia, serif;
  font-size: 15px;
  color: var(--navy);
  margin-bottom: 20px;
}
.enigme-form input:focus {
  outline: none;
  border-color: var(--copper);
}
.enigme-form label + label {
  margin-top: 4px;
}

.counters-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 20px;
}

/* ---------- Énigme à choix avec pénalité (boutons) ---------- */

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.choice-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  border: 1.5px solid var(--grey-line);
  border-radius: 4px;
  padding: 24px 12px;
  cursor: pointer;
  font-family: Georgia, serif;
  transition: all 0.15s ease;
}
.choice-button:hover {
  border-color: var(--copper);
  background: var(--white);
  transform: translateY(-2px);
}
.choice-emoji {
  font-size: 40px;
  line-height: 1;
}
.choice-label {
  font-size: 14px;
  color: var(--navy);
}

.choice-warning {
  font-size: 13px;
  color: var(--red);
  text-align: center;
}

/* ---------- Faux Simon (compteurs déguisés en jeu de mémoire) ---------- */

.simon-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.simon-button {
  position: relative;
  aspect-ratio: 1;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
  box-shadow: inset 0 -6px 10px rgba(0,0,0,0.2), 0 3px 6px rgba(0,0,0,0.15);
}
.simon-button:active {
  transform: scale(0.94);
}
.simon-button.simon-flash {
  box-shadow: inset 0 -6px 10px rgba(0,0,0,0.1), 0 0 22px 6px currentColor;
}

.simon-color-rouge   { background: #E53935; color: #E53935; }
.simon-color-orange  { background: #FB8C00; color: #FB8C00; }
.simon-color-jaune   { background: #FDD835; color: #FDD835; }
.simon-color-vert    { background: #43A047; color: #43A047; }
.simon-color-bleu    { background: #1E88E5; color: #1E88E5; }

.simon-count {
  color: rgba(255,255,255,0.9);
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 20px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  pointer-events: none;
}

.simon-hint {
  font-size: 13px;
  color: var(--grey);
  text-align: center;
  margin-bottom: 4px;
}

@media (max-width: 480px) {
  .simon-board { gap: 8px; }
}

/* ---------- Checklist (jeu des 7 erreurs) ---------- */

.checklist-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.enigme-form label.checklist-item {
  display: grid;
  grid-template-columns: 20px auto;
  align-items: center;
  column-gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--grey-line);
  border-radius: 6px;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: normal;
  line-height: 1.4;
  color: var(--navy);
  background: white;
  margin-bottom: 0;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.enigme-form label.checklist-item:hover {
  border-color: var(--copper);
  background: var(--copper-light);
}
.enigme-form label.checklist-item:has(input:checked) {
  border-color: var(--copper);
  background: var(--copper-light);
}

.checklist-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  vertical-align: middle;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 2px solid var(--grey-line);
  border-radius: 5px;
  background: white;
  cursor: pointer;
  position: relative;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.checklist-item input[type="checkbox"]:hover {
  border-color: var(--copper);
}
.checklist-item input[type="checkbox"]:checked {
  background: var(--copper);
  border-color: var(--copper);
}
.checklist-item input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -60%) rotate(45deg);
}

.checklist-item span {
  grid-column: 2;
  grid-row: 1;
}

/* ---------- Carte de freeze (pénalité en cours) ---------- */

.freeze-card {
  text-align: center;
  padding: 40px 32px;
}
.freeze-icon {
  font-size: 36px;
  margin-bottom: 8px;
}
.freeze-label {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
}
.freeze-timer {
  font-family: 'Courier New', monospace;
  font-size: 48px;
  font-weight: bold;
  color: var(--navy);
  margin-bottom: 16px;
  letter-spacing: 2px;
}
.freeze-hint {
  font-size: 13.5px;
  color: var(--grey);
}

@media (max-width: 480px) {
  .counters-grid { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .topbar { flex-direction: column; gap: 10px; align-items: flex-start; }
  .page { padding: 24px 16px 60px; }
}

/* ---------- Énigme mixte (plusieurs blocs hétérogènes + freeze) ---------- */

.mixed-blocs {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 16px;
}

.mixed-bloc {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--grey-line);
}
.mixed-bloc:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.mixed-bloc-label {
  font-family: Georgia, serif;
  font-weight: bold;
  font-size: 14px;
  color: var(--navy);
  margin-bottom: 10px;
}

.mixed-bloc-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--grey-line);
  border-radius: 3px;
  font-family: Georgia, serif;
  font-size: 15px;
  color: var(--navy);
  box-sizing: border-box;
}
.mixed-bloc-input:focus {
  outline: none;
  border-color: var(--copper);
}

.mixed-bloc-radios {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mixed-radio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--grey-line);
  border-radius: 6px;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 14px;
  color: var(--navy);
  background: white;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.mixed-radio-item:hover {
  border-color: var(--copper);
  background: var(--copper-light);
}
.mixed-radio-item:has(input:checked) {
  border-color: var(--copper);
  background: var(--copper-light);
}
.mixed-radio-item input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--copper);
  cursor: pointer;
  flex-shrink: 0;
}

/* ---------- Défi de code (code_challenge) ---------- */

.code-challenge-instructions {
  font-size: 14px;
  color: var(--navy);
  margin-bottom: 14px;
  line-height: 1.5;
}
.code-challenge-instructions code {
  background: var(--paper);
  border: 1px solid var(--grey-line);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: var(--copper);
}

.code-editor {
  display: block;
  width: 100%;
  height: 260px;
  min-height: 260px;
  padding: 16px 18px;
  background: #1E1E2E;
  color: #CDD6F4;
  border: none;
  border-radius: 0;
  font-family: 'Courier New', Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}
.code-editor:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--copper);
}

.code-editor-wrapper {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.code-editor-titlebar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  background: #181825;
}
.code-editor-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.code-editor-dot-red { background: #F38BA8; }
.code-editor-dot-yellow { background: #F9E2AF; }
.code-editor-dot-green { background: #A6E3A1; }
.code-editor-titlebar-label {
  margin-left: 8px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #9399B2;
}

.btn-secondary {
  width: 100%;
  padding: 12px 16px;
  margin-top: 12px;
  background: white;
  color: var(--navy);
  border: 1.5px solid var(--navy);
  border-radius: 3px;
  font-family: Georgia, serif;
  font-size: 14.5px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.btn-secondary:hover {
  background: var(--navy);
  color: white;
}

.code-results {
  margin-top: 14px;
}
.code-result-line {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: var(--navy);
  padding: 6px 10px;
  background: var(--paper);
  border-radius: 3px;
  margin-bottom: 4px;
}
.code-result-error {
  background: #FDECEC;
  color: #B3261E;
}
.code-result-hint {
  font-size: 13px;
  color: var(--grey);
  font-style: italic;
  margin-top: 8px;
}

.enigme-form button[type="submit"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- Grille de déduction (type Einstein) ---------- */

.grille-deduction-wrapper {
  overflow-x: auto;
  margin-top: 6px;
}

.grille-deduction {
  width: 100%;
  border-collapse: collapse;
  font-family: Georgia, serif;
}

.grille-deduction th,
.grille-deduction td {
  border: 1px solid var(--grey-line);
  padding: 8px;
  text-align: center;
}

.grille-deduction thead th {
  background: var(--navy);
  color: white;
  font-size: 12.5px;
  font-weight: bold;
  white-space: nowrap;
  padding: 10px 8px;
}

.grille-deduction tbody th {
  background: var(--copper-light);
  color: var(--navy);
  font-weight: bold;
  font-size: 13.5px;
  white-space: nowrap;
  padding: 10px 8px;
}

.grille-deduction-input {
  width: 100%;
  min-width: 90px;
  padding: 6px 8px;
  border: 1px solid var(--grey-line);
  border-radius: 3px;
  font-family: Georgia, serif;
  font-size: 13px;
  color: var(--navy);
  text-align: center;
  box-sizing: border-box;
}
.grille-deduction-input:focus {
  outline: none;
  border-color: var(--copper);
  background: var(--copper-light);
}

@media (max-width: 600px) {
  .grille-deduction th,
  .grille-deduction td {
    padding: 5px;
    font-size: 11.5px;
  }
  .grille-deduction-input {
    min-width: 70px;
    font-size: 11.5px;
    padding: 4px 5px;
  }
}

/* ---------- Étiquettes copiables (grille de déduction) ---------- */

.grille-deduction-etiquettes {
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--paper);
  border-radius: 6px;
}

.grille-deduction-etiquette-groupe {
  margin-bottom: 10px;
}
.grille-deduction-etiquette-groupe:last-of-type {
  margin-bottom: 6px;
}

.grille-deduction-etiquette-titre {
  font-family: Georgia, serif;
  font-weight: bold;
  font-size: 12.5px;
  color: var(--navy);
  margin-bottom: 6px;
}

.grille-deduction-etiquette-liste {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.grille-deduction-etiquette {
  padding: 5px 12px;
  background: white;
  border: 1.5px solid var(--copper);
  border-radius: 14px;
  font-family: 'Courier New', monospace;
  font-size: 12.5px;
  color: var(--copper);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.grille-deduction-etiquette:hover {
  background: var(--copper);
  color: white;
}
.grille-deduction-etiquette-copiee {
  background: var(--copper) !important;
  color: white !important;
}

.grille-deduction-etiquette-aide {
  font-size: 12px;
  color: var(--grey);
  font-style: italic;
  margin-top: 8px;
}

.grille-deduction-legende {
  font-size: 12px;
  color: var(--grey);
  margin-top: 6px;
  font-style: italic;
}

/* ---------- Termes surlignés cliquables (dans le texte de l'énoncé) ---------- */

.terme-surligne {
  display: inline-block;
  padding: 1px 7px;
  background: var(--copper-light);
  border: 1px solid var(--copper);
  border-radius: 10px;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 0.92em;
  color: var(--copper);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.terme-surligne:hover {
  background: var(--copper);
  color: white;
}
.terme-surligne-copie {
  background: var(--copper) !important;
  color: white !important;
}

/* ---------- Image dans l'énoncé (capture d'écran, photo...) ---------- */

.enigme-image {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}
.enigme-image img {
  width: 260px;
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.enigme-image-clickable {
  cursor: zoom-in;
  transition: transform 0.12s ease;
}
.enigme-image-clickable:hover {
  transform: scale(1.02);
}

.image-zoom-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 21, 38, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 24px;
  box-sizing: border-box;
}
.image-zoom-img {
  max-width: 95vw;
  max-height: 95vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

/* ---------- Bureau simulé interactif (security_audit) ---------- */

.desktop-sim {
  margin-top: 18px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  background: #0D1117;
}
.desktop-sim-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: #161B22;
}
.desktop-sim-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.desktop-sim-title {
  margin-left: 10px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #8B949E;
}
.desktop-sim-body {
  padding: 22px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background:
    linear-gradient(135deg, #0D1117 0%, #14213D 100%);
  min-height: 260px;
}

.desktop-icon {
  width: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.desktop-icon:hover {
  background: rgba(255,255,255,0.08);
}
.icon-box {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  border: 2px solid;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-label {
  font-family: 'Courier New', monospace;
  font-size: 9px;
  font-weight: bold;
}
.icon-name {
  font-size: 10px;
  color: #C9D1D9;
  text-align: center;
  line-height: 1.25;
  word-break: break-word;
  max-width: 82px;
}

.file-viewer-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 21, 38, 0.75);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}
.file-viewer-window {
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  background: #0D1117;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
}
.file-viewer-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #161B22;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #E6EDF3;
}
.file-viewer-close {
  cursor: pointer;
  color: #8B949E;
  font-size: 18px;
  line-height: 1;
}
.file-viewer-close:hover {
  color: #F85149;
}
.file-viewer-content {
  padding: 18px 20px;
  overflow-y: auto;
}

.fv-text {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #C9D1D9;
  white-space: pre-wrap;
  line-height: 1.6;
}

.fv-document {
  background: #161B22;
  padding: 8px;
}
.fv-doc-page {
  background: #FFFFFF;
  color: #1C2333;
  padding: 26px 28px;
  border-radius: 4px;
  font-family: Georgia, serif;
  font-size: 13px;
  white-space: pre-wrap;
  line-height: 1.7;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.fv-image {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.fv-image img {
  width: 100%;
  height: auto;
  display: block;
}

.fv-spreadsheet {
  padding: 4px;
}
.fv-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Courier New', monospace;
  font-size: 12.5px;
}
.fv-table th {
  background: #21262D;
  color: #E6EDF3;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid #30363D;
}
.fv-table td {
  color: #C9D1D9;
  padding: 7px 10px;
  border: 1px solid #30363D;
  background: #0D1117;
}

.fv-pdf {
  background: #161B22;
  padding: 8px;
}
.fv-pdf-page {
  background: #FFFFFF;
  color: #1C2333;
  padding: 30px 28px;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.fv-pdf-heading {
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 16px;
  border-bottom: 2px solid #1C2333;
  padding-bottom: 8px;
}
.fv-pdf-body {
  font-family: 'Courier New', monospace;
  font-size: 12.5px;
  white-space: pre-wrap;
  line-height: 1.7;
  color: #3A4258;
}

.fv-media {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}
.fv-media-box {
  width: 100%;
  height: 160px;
  background: #161B22;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.fv-media-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #30363D;
  color: #E6EDF3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.fv-media-duration {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #8B949E;
}
.fv-audio-box { flex-direction: column; }
.fv-audio-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 40px;
}
.fv-audio-wave span {
  display: inline-block;
  width: 3px;
  background: #A371F7;
  border-radius: 2px;
  height: 100%;
}
.fv-audio-wave span:nth-child(odd) { height: 60%; }
.fv-audio-wave span:nth-child(3n) { height: 35%; }
.fv-audio-wave span:nth-child(4n) { height: 85%; }

.fv-presentation {
  padding: 4px;
}
.fv-slide {
  background: #FFFFFF;
  color: #1C2333;
  border-radius: 4px;
  padding: 28px 30px;
  aspect-ratio: 16/9;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}
.fv-slide-title {
  font-family: Georgia, serif;
  font-size: 19px;
  font-weight: bold;
  color: #14213D;
  border-bottom: 3px solid #B08D57;
  padding-bottom: 10px;
  margin-bottom: 16px;
}
.fv-slide-bullets {
  list-style: disc;
  padding-left: 20px;
  font-family: 'DejaVu Sans', Arial, sans-serif;
  font-size: 13.5px;
  line-height: 2;
  color: #2A3346;
}

.fv-folder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.fv-folder-empty {
  font-family: 'Courier New', monospace;
  font-size: 12.5px;
  color: #6E7681;
  font-style: italic;
}

/* ---------- Bouton de téléchargement de fichier ---------- */

.enigme-download {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}
.enigme-download-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--navy);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: bold;
  transition: background 0.15s ease;
}
.enigme-download-link:hover {
  background: var(--copper);
}
.enigme-download-icon {
  font-size: 16px;
}

/* ---------- Animation de confettis (fin de parcours) ---------- */

.confetti-canvas {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  min-width: 100%;
  min-height: 100%;
  pointer-events: none;
  z-index: 2000;
}
