/* --- Le Temple de la Chair --- */
.doctor-layout {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.doctor-left-panel,
.doctor-right-panel {
  flex: 1;
  background: rgba(10, 15, 25, 0.85);
  border: 2px solid #2a3b5c;
  border-radius: 8px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.doctor-left-panel {
  flex: 1.2;
}

/* --- L'Inquisiteur --- */
.current-doctor-box {
  background: rgba(20, 30, 45, 0.9);
  border: 1px solid #3b5284;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 20px;
}

.current-doctor-box h2 {
  font-size: 1.1em;
  margin-bottom: 15px;
  color: #a0b4d6;
  border-bottom: 1px solid #3b5284;
  padding-bottom: 5px;
}

.current-doctor-display {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.doctor-image {
  width: 64px;
  height: 64px;
  border-radius: 4px;
  border: 2px solid #5a75a6;
  image-rendering: pixelated;
  background: #0d1320;
}

.doctor-info {
  flex: 1;
}

.doctor-name {
  font-family: 'Cinzel', serif;
  font-size: 1.2em;
  font-weight: bold;
  color: #fff;
  margin: 0 0 5px 0;
}

.doctor-speech {
  font-size: 0.9em;
  font-style: italic;
  color: #bdcde8;
  margin: 0;
}

.doctor-actions-row {
  display: flex;
  gap: 10px;
}

.med-btn {
  flex: 1;
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
  border: 2px solid #60a5fa;
  color: white;
  padding: 4px 6px;
  border-radius: 6px;
  font-family: 'Patrick Hand', cursive;
  font-size: 0.95em;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.med-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  transform: scale(1.05);
}

.med-btn:disabled {
  background: #374151;
  border-color: #4b5563;
  color: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

.small-price {
  font-size: 0.8em;
  opacity: 0.8;
}

/* --- Les Praticiens --- */
.doctors-list-box h3 {
  font-size: 1.1em;
  color: #a0b4d6;
  margin-bottom: 10px;
}

.doctors-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 6px;
  overflow: hidden;
}

.doctors-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  color: #000000;
  /* Police en noir */
  background: #81e6d9;
  /* Fond bleu clair/cyan/vert */
  font-weight: 500;
}

.doctors-table tr:hover td {
  background: #a5f3fc;
  /* Survol cyan encore plus lumineux */
}

.doctors-table tr.special-doc-row td {
  background: #10b981;
  color: #fff;
  font-weight: bold;
  border-top: 2px solid #047857;
  border-bottom: 2px solid #047857;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.doctors-table tr.special-doc-row:hover td {
  background: #059669;
}

.doctors-table tr.special-doc-row .hire-btn {
  background: #f59e0b;
  border-color: #d97706;
  color: white;
  text-shadow: none;
}

.doctors-table tr.special-doc-row .hire-btn:hover {
  background: #d97706;
}

.hire-btn {
  background: #059669;
  border: 1px solid #34d399;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.82em;
  font-weight: bold;
  line-height: 1.1;
  text-align: center;
}

.hire-btn:hover {
  background: #10b981;
}

/* --- Le Miroir des Os --- */
.doctor-right-panel h2 {
  font-size: 1.1em;
  color: #a0b4d6;
  margin-bottom: 15px;
  text-align: center;
}

.xray-container {
  position: relative;
  width: 100%;
  background: #000;
  border: 3px solid #1e293b;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 15px;
  aspect-ratio: 1;
}

.xray-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  filter: contrast(1.2) brightness(0.9);
}

.red-dots-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.red-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 5px #ef4444;
  animation: pulse-dot 2s infinite alternate;
}

@keyframes pulse-dot {
  0% {
    opacity: 0.5;
    transform: scale(0.8);
  }

  100% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.xray-obscurer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #ef4444;
  font-family: 'Cinzel', serif;
  font-size: 1.2em;
  text-align: center;
  backdrop-filter: blur(4px);
}

.phase-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: auto;
}

.phase-display p {
  color: #cbd5e1;
  font-size: 1.1em;
  margin: 0;
}

.phase-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #7f1d1d;
  border: 2px solid #ef4444;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Cinzel', serif;
  font-weight: bold;
  font-size: 1.2em;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* --- L'Ombre Intérieure --- */
#cancerAlertOverlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  pointer-events: none !important;
  /* Non-cliquable par défaut */
  background: rgba(0, 0, 0, 0) !important;
  transition: background 0.25s ease-in !important;
  /* 2 fois plus rapide (1s au lieu de 2s) */
}

#cancerAlertOverlay.show-active {
  pointer-events: auto !important;
  background: rgba(0, 0, 0, 1) !important;
}

#cancerAlertOverlay.fade-out-active {
  pointer-events: none !important;
  background: rgba(0, 0, 0, 0) !important;
  transition: background 0.25s ease-in-out !important;
  /* 2 fois plus rapide (0.5s au lieu de 1s) */
}

/* Éléments textuels enfants */
#cancerAlertOverlay .god-text,
#cancerAlertOverlay .god-actions {
  opacity: 0 !important;
  transition: opacity 0.5s ease-in !important;
  /* 2 fois plus rapide (0.5s au lieu de 1s) */
}

#cancerAlertOverlay.show-active .god-text,
#cancerAlertOverlay.show-active .god-actions {
  opacity: 1 !important;
  transition-delay: 1.1s !important;
  /* Débute 1.1s après le début du fondu au noir (ajusté pour 1s de fondu) */
}

#cancerAlertOverlay.fade-out-active .god-text,
#cancerAlertOverlay.fade-out-active .god-actions {
  opacity: 0 !important;
  transition: opacity 0.5s ease-in-out !important;
  /* 2 fois plus rapide (0.5s au lieu de 1s) */
}

/* --- Le Crépuscule --- */
.game-over-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  background: rgba(0, 0, 0, 0.95) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  backdrop-filter: blur(10px) !important;
  animation: fadeInGameOver 1s ease-out forwards !important;
}

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

.game-over-card {
  background: #111 !important;
  border: 2px solid #ef4444 !important;
  padding: 40px !important;
  border-radius: 12px !important;
  text-align: center !important;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.4) !important;
  max-width: 450px !important;
  width: 90% !important;
  font-family: 'Cinzel', serif !important;
}

.game-over-title {
  color: #ef4444 !important;
  font-size: 3em !important;
  margin: 0 0 10px 0 !important;
  letter-spacing: 3px !important;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.5) !important;
}

.game-over-subtitle {
  color: #aaa !important;
  font-size: 1.1em !important;
  margin: 0 0 30px 0 !important;
  line-height: 1.4 !important;
}

.game-over-score-box {
  background: #1a1a1a !important;
  border: 1px solid #333 !important;
  padding: 20px !important;
  border-radius: 8px !important;
  margin-bottom: 30px !important;
}

.score-label {
  display: block !important;
  color: #888 !important;
  font-size: 0.9em !important;
  margin-bottom: 5px !important;
}

.score-value {
  display: block !important;
  color: #ef4444 !important;
  font-size: 2.2em !important;
  font-weight: bold !important;
  text-shadow: 0 0 5px rgba(239, 68, 68, 0.3) !important;
}

.game-over-btn {
  background: linear-gradient(135deg, #ef4444, #991b1b) !important;
  color: #fff !important;
  border: none !important;
  padding: 12px 40px !important;
  font-size: 1.2em !important;
  font-weight: bold !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3) !important;
}

.game-over-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.6) !important;
}

@keyframes fadeInGameOver {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* --- La Célestisation --- */
.heaven-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  background: rgba(255, 255, 255, 0.95) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  backdrop-filter: blur(10px) !important;
  animation: fadeInHeaven 1.2s ease-out forwards !important;
}

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

.heaven-card {
  background: linear-gradient(135deg, #ffffff, #f0f7ff) !important;
  border: 3px solid #fbbf24 !important;
  padding: 40px !important;
  border-radius: 16px !important;
  text-align: center !important;
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.5) !important;
  max-width: 480px !important;
  width: 90% !important;
  font-family: 'Cinzel', serif !important;
}

.heaven-title {
  color: #d97706 !important;
  font-size: 3.2em !important;
  margin: 0 0 10px 0 !important;
  letter-spacing: 4px !important;
  text-shadow: 0 0 15px rgba(251, 191, 36, 0.4) !important;
}

.heaven-subtitle {
  color: #4b5563 !important;
  font-size: 1.1em !important;
  margin: 0 0 30px 0 !important;
  line-height: 1.5 !important;
  font-family: 'Inter', sans-serif !important;
}

.heaven-score-box {
  background: #fff8e6 !important;
  border: 1.5px dashed #fcd34d !important;
  padding: 20px !important;
  border-radius: 10px !important;
  margin-bottom: 30px !important;
}

.score-value-gold {
  display: block !important;
  color: #b45309 !important;
  font-size: 2.2em !important;
  font-weight: bold !important;
  text-shadow: 0 0 5px rgba(251, 191, 36, 0.3) !important;
}

.heaven-btn {
  background: linear-gradient(135deg, #fbbf24, #d97706) !important;
  color: #fff !important;
  border: none !important;
  padding: 14px 45px !important;
  font-size: 1.25em !important;
  font-weight: bold !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3) !important;
}

.heaven-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 25px rgba(217, 119, 6, 0.5) !important;
}

@keyframes fadeInHeaven {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* --- Le Brasier --- */
.hell-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  background: rgba(15, 0, 0, 0.96) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  backdrop-filter: blur(12px) !important;
  animation: fadeInHell 1.2s ease-out forwards !important;
}

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

.hell-card {
  background: linear-gradient(135deg, #110000, #220000) !important;
  border: 3px solid #dc2626 !important;
  padding: 40px !important;
  border-radius: 16px !important;
  text-align: center !important;
  box-shadow: 0 0 50px rgba(220, 38, 38, 0.6) !important;
  max-width: 480px !important;
  width: 90% !important;
  font-family: 'Cinzel', serif !important;
}

.hell-title {
  color: #ef4444 !important;
  font-size: 3.2em !important;
  margin: 0 0 10px 0 !important;
  letter-spacing: 4px !important;
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.7) !important;
}

.hell-subtitle {
  color: #fca5a5 !important;
  font-size: 1.1em !important;
  margin: 0 0 30px 0 !important;
  line-height: 1.5 !important;
  font-family: 'Inter', sans-serif !important;
}

.hell-btn {
  background: linear-gradient(135deg, #ef4444, #7f1d1d) !important;
  color: #fff !important;
  border: none !important;
  padding: 14px 45px !important;
  font-size: 1.25em !important;
  font-weight: bold !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4) !important;
}

.hell-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 25px rgba(239, 68, 68, 0.6) !important;
}

@keyframes fadeInHell {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* --- Les Flammes du Châtiment --- */
body.is-hell-active {
  position: relative;
  overflow-x: hidden;
}

/* Superposition de chaleur extreme sans distorsion de couleur */
body.is-hell-active::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.05) 0%, rgba(10, 0, 1, 0.5) 100%);
  animation: heatVibration 2s infinite alternate ease-in-out;
}

/* Vague de chaleur vibrante subtile (opacité) */
@keyframes heatVibration {
  0% {
    opacity: 0.6;
  }

  100% {
    opacity: 0.9;
  }
}

body.is-hell-active::after {
  content: "";
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 150px;
  z-index: 9999;
  pointer-events: none;
  background: linear-gradient(to top, rgba(239, 68, 68, 0.45) 0%, rgba(239, 68, 68, 0) 100%);
  animation: hellFireRise 1.5s infinite alternate ease-in-out;
}

@keyframes hellFireRise {
  0% {
    opacity: 0.7;
    height: 120px;
  }

  100% {
    opacity: 0.95;
    height: 170px;
    filter: brightness(1.3);
  }
}

body.is-hell-active .screen {
  animation: pulseHell 2.5s infinite ease-in-out !important;
  border: 3px dashed #ef4444 !important;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.7), inset 0 0 35px rgba(220, 38, 38, 0.4) !important;
}

@keyframes pulseHell {
  0% {
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.7), inset 0 0 35px rgba(220, 38, 38, 0.4) !important;
    border-color: #ef4444 !important;
  }

  50% {
    box-shadow: 0 0 45px rgba(249, 115, 22, 0.9), inset 0 0 55px rgba(239, 68, 68, 0.6) !important;
    border-color: #f97316 !important;
  }

  100% {
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.7), inset 0 0 35px rgba(220, 38, 38, 0.4) !important;
    border-color: #ef4444 !important;
  }
}

/* Menus, Cartes, Panels style Magma & Lave */
body.is-hell-active .place-card,
body.is-hell-active .header,
body.is-hell-active .doctor-left-panel,
body.is-hell-active .doctor-right-panel,
body.is-hell-active .cabinet-title,
body.is-hell-active .item-card,
body.is-hell-active .market-grid>div,
body.is-hell-active .bank-action-box {
  border: 2px solid #ef4444 !important;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.6), inset 0 0 10px rgba(185, 28, 28, 0.5) !important;
  background: linear-gradient(135deg, #180206 0%, #2a050d 100%) !important;
  color: #fee2e2 !important;
  position: relative;
  overflow: hidden;
}

body.is-hell-active .place-card::before,
body.is-hell-active .doctor-left-panel::before,
body.is-hell-active .doctor-right-panel::before,
body.is-hell-active .bank-action-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0) 70%);
  pointer-events: none;
  animation: heatPulseCard 3s infinite alternate ease-in-out;
}

@keyframes heatPulseCard {
  0% {
    opacity: 0.4;
  }

  100% {
    opacity: 0.95;
  }
}

/* Boutons speciaux en enfer */
body.is-hell-active button {
  border-color: #ef4444 !important;
  text-shadow: 0 0 5px rgba(239, 68, 68, 0.5) !important;
}

/* Affichage rouge pour l'argent en enfer */
body.is-hell-active #moneyDisplay {
  color: #ef4444 !important;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.8) !important;
  animation: hellMoneyPulse 0.3s infinite alternate !important;
  display: inline-block;
}

@keyframes hellMoneyPulse {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(1.04);
  }
}

/* Cooldown boutons jour suivant en enfer */
body.is-hell-active .next-day-btn:disabled,
body.is-hell-active .next-day-btn.cooldown-active {
  background: linear-gradient(135deg, #3b0712, #180206) !important;
  color: #b91c1c !important;
  border: 2px solid #7f1d1d !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

/* --- Le Souffle Céleste --- */
body.is-heaven-active {
  position: relative;
  overflow-x: hidden;
}

/* Halo blanc immacule et vert clair celeste (Vignette plus prononcee et large) */
body.is-heaven-active::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0) 35%, rgba(52, 211, 153, 0.20) 100%);
  animation: heavenHaloPulse 5s infinite alternate ease-in-out;
}

@keyframes heavenHaloPulse {
  0% {
    opacity: 0.6;
  }

  100% {
    opacity: 0.9;
  }
}

/* Aura celestre plus prononcee et large en arriere-plan */
body.is-heaven-active::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: radial-gradient(circle at 50% 100%, rgba(52, 211, 153, 0.16) 0%, rgba(255, 255, 255, 0) 95%);
  animation: heavenAuraFloating 6s infinite alternate ease-in-out;
}

@keyframes heavenAuraFloating {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.7;
  }

  100% {
    transform: translateY(-12px) scale(1.03);
    opacity: 1;
  }
}

/* Halo blanc leger sur tous les menus (ecrans) */
body.is-heaven-active .screen {
  box-shadow: 0 0 35px rgba(255, 255, 255, 0.95), inset 0 0 25px rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
}

/* Empecher de cacher le bouton Jour suivant en enfer */
body.is-hell-active.tripping-hard-mode .next-day-btn,
body.is-hell-active.tripping-hard-mode [data-next-day] {
  display: inline-block !important;
}

/* =============================================
   LEADERBOARD & SCORE SUBMIT
   ============================================= */

.leaderboard-open-btn {
  display: inline-block;
  margin: 14px 0 0 20px;
  padding: 11px 32px;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #fff;
  font-size: 1.05em;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 1px;
  box-shadow: 0 4px 18px rgba(251, 191, 36, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.leaderboard-open-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(251, 191, 36, 0.55);
}

.leaderboard-open-btn:disabled {
  background: linear-gradient(135deg, #475569, #334155);
  color: #94a3b8;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  transform: none;
  cursor: not-allowed;
  border: 1px solid #1e293b;
}

#leaderboard-screen {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000001;
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
  border: 2px solid #fbbf24;
  border-radius: 20px;
  padding: 36px 40px 28px;
  min-width: 340px;
  max-width: 520px;
  width: 92vw;
  box-shadow: 0 0 60px rgba(251, 191, 36, 0.22), 0 20px 60px rgba(0, 0, 0, 0.7);
  animation: lbFadeIn 0.35s ease-out;
}

@keyframes lbFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -52%) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes ssCardIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lb-header {
  text-align: center;
  margin-bottom: 22px;
}

.lb-trophy {
  font-size: 2.8em;
  display: block;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.6));
}

.lb-title {
  color: #fbbf24;
  font-size: 1.55em;
  font-family: 'Cinzel', serif;
  letter-spacing: 2px;
  margin: 0;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 22px;
}

.lb-table thead th {
  color: #fbbf24;
  font-size: 0.82em;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(251, 191, 36, 0.3);
  padding: 8px 10px;
  text-align: left;
}

.lb-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.15s;
}

.lb-table tbody tr:hover {
  background: rgba(251, 191, 36, 0.06);
}

.lb-table tbody tr:first-child td.lb-rank {
  color: #fbbf24;
  font-size: 1.15em;
  font-weight: 800;
}

.lb-table tbody tr:nth-child(2) td.lb-rank {
  color: #9ca3af;
  font-weight: 700;
}

.lb-table tbody tr:nth-child(3) td.lb-rank {
  color: #b45309;
  font-weight: 700;
}

.lb-table tbody td {
  padding: 10px;
  color: #e5e7eb;
  font-size: 0.97em;
}

.lb-table td.lb-rank {
  font-weight: 700;
  width: 48px;
  text-align: center;
}

.lb-table td.lb-score {
  color: #fcd34d;
  font-weight: 600;
}

.lb-table tr.lb-highlight td {
  color: #34d399;
  font-weight: 700;
}

.lb-close-btn {
  display: block;
  margin: 0 auto;
  padding: 10px 38px;
  background: rgba(255, 255, 255, 0.07);
  color: #d1d5db;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95em;
  transition: background 0.2s, color 0.2s;
}

.lb-close-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

#score-submit-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000002;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.ss-card {
  background: linear-gradient(160deg, #1a1a2e, #16213e);
  border: 2px solid #6366f1;
  border-radius: 18px;
  padding: 38px 44px 32px;
  max-width: 440px;
  width: 90vw;
  text-align: center;
  box-shadow: 0 0 50px rgba(99, 102, 241, 0.3), 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: ssCardIn 0.35s ease-out;
}

.ss-title {
  color: #a5b4fc;
  font-family: 'Cinzel', serif;
  font-size: 1.6em;
  letter-spacing: 2px;
  margin: 0 0 18px;
}

.ss-label {
  color: #9ca3af;
  font-size: 0.9em;
  margin: 10px 0 4px;
}

.ss-score {
  color: #fbbf24;
  font-size: 2em;
  font-weight: 800;
  margin: 0 0 18px;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.ss-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  font-size: 1em;
  border-radius: 8px;
  border: 1.5px solid #6366f1;
  background: rgba(255, 255, 255, 0.07);
  color: #f3f4f6;
  margin-bottom: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.ss-input:focus {
  border-color: #a5b4fc;
}

.ss-submit-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 1.05em;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.ss-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5);
}

.ss-feedback {
  margin-top: 14px;
  font-size: 0.95em;
  font-weight: 600;
  min-height: 1.4em;
  color: #34d399;
}

/* --- L'Émissaire --- */
.facteur-card {
  position: relative;
  background: #e5e5e5;
  border: 3px solid #8b5a2b;
  border-radius: 12px;
  padding: 25px 35px;
  width: 90vw;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.6);
  animation: ssCardIn 0.3s ease-out;
  color: #333;
  font-family: 'Patrick Hand', cursive;
}

.facteur-close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5em;
  color: #666;
  cursor: pointer;
}

.facteur-close-btn:hover {
  color: #000;
}

.facteur-title {
  font-size: 2.2em;
  color: #8b5a2b;
  margin: 0 0 10px;
}

.facteur-subtitle {
  font-size: 1.4em;
  color: #555;
  margin-bottom: 25px;
}

.facteur-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 10px;
}

.facteur-actions button {
  flex: 1;
  padding: 12px;
  font-size: 1.3em;
  font-family: inherit;
  background: #fff;
  border: 2px solid #8b5a2b;
  border-radius: 8px;
  color: #8b5a2b;
  cursor: pointer;
  transition: 0.2s;
}

.facteur-actions button:hover {
  background: #8b5a2b;
  color: #fff;
}

.facteur-input,
.facteur-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  font-size: 1.2em;
  font-family: 'Patrick Hand', cursive;
  border: 2px solid #ccc;
  border-radius: 6px;
  margin-bottom: 15px;
  resize: none;
  background: #fafafa;
}

.facteur-input:focus,
.facteur-textarea:focus {
  border-color: #8b5a2b;
  outline: none;
}

.facteur-stamps {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.facteur-stamps button {
  flex: 1;
  padding: 10px;
  font-family: inherit;
  font-size: 1.2em;
  border-radius: 6px;
  cursor: pointer;
  border: 2px dashed #8b5a2b;
  background: #fdf5e6;
  color: #8b5a2b;
  transition: 0.2s;
}

.facteur-stamps button:hover {
  background: #ffe4b5;
}

.facteur-stamps button.stamp-special {
  border: 2px dashed #b22222;
  color: #b22222;
  background: #fff0f5;
}

.facteur-stamps button.stamp-special:hover {
  background: #ffb6c1;
}

.facteur-back-btn {
  margin-top: 15px;
  background: none;
  border: none;
  color: #8b5a2b;
  font-size: 1.2em;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.facteur-messages-list {
  max-height: 300px;
  overflow-y: auto;
  text-align: left;
  padding-right: 10px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 15px;
}

.facteur-msg-item {
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s;
}

.facteur-msg-item:hover {
  filter: brightness(0.97);
}

.facteur-msg-item.expanded {
  align-items: flex-start;
  padding: 12px;
}

.facteur-msg-item:last-child {
  border-bottom: none;
}

.facteur-msg-icon {
  font-size: 1.6em;
}

.facteur-msg-icon.special {
  color: #b22222;
}

.facteur-msg-content {
  flex: 1;
  overflow: hidden;
}

.facteur-msg-header {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  margin-bottom: 2px;
  color: #555;
}

.facteur-msg-text {
  font-size: 1.05em;
  line-height: 1.2;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.facteur-msg-item.expanded .facteur-msg-text {
  white-space: normal;
  word-break: break-word;
  margin-bottom: 8px;
}

.facteur-msg-signature {
  display: none;
}

.facteur-msg-item.expanded .facteur-msg-signature {
  display: block;
  margin-bottom: 8px;
}

.facteur-msg-actions {
  display: none;
  margin-top: 10px;
  text-align: right;
}

.facteur-msg-item.expanded .facteur-msg-actions {
  display: block;
}

.facteur-feedback {
  font-weight: bold;
  font-size: 1.2em;
  min-height: 1.5em;
  margin: 10px 0 0;
}

.place-card.facteur {
  background: linear-gradient(135deg, #d2b48c, #8b4513);
  border-color: #5c3a21;
  color: white;
}

.place-card.facteur:hover {
  background: linear-gradient(135deg, #e3c59d, #a0522d);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(139, 69, 19, 0.3);
}