body.preload {
  opacity: 0 !important;
  overflow: hidden;
}

body.loaded {
  opacity: 1 !important;
  overflow: auto;
  transition: opacity 0.4s ease-in-out;
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(120deg, #fce4ec, #e0f7fa, #fffde7);
  background-size: 200% 200%;
  animation: gradientBG 10s ease infinite;
  min-height: 100vh;
  color: #222;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.fact-card {
  background: transparent;
  border-radius: 0;
  padding: 40px 20px;
  box-shadow: none;
  text-align: center;
  width: 100%;
  max-width: none;
  margin: 60px auto 0 auto;
  animation: fadeIn 0.5s ease-in-out;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.fact-card:hover {
  box-shadow: none;
}

.fact {
  font-size: 1.75rem;
  margin: 30px 0;
  color: #333;
  line-height: 1.4;
  font-weight: 500;
}

#fact-display {
  min-height: 0;
  margin-top: 24px;
}

.stats {
  margin-top: 30px;
  font-size: 1.1rem;
  color: #555;
  font-weight: 400;
}

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

/* Bouton changer de thème */
#change-theme-btn {
  display: inline-block;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50px;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  margin: 0 auto 20px auto;
  transition: all 0.25s ease-in-out;
  cursor: pointer;
  max-width: fit-content;
}

#change-theme-btn:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
}

/* Boutons vote adoucis */
.btn-vote-success,
.btn-vote-info {
  font-size: 18px;
  font-weight: 700;
  padding: 14px 36px;
  border-radius: 50px;
  border: none;
  width: 240px;
  max-width: 95%;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.btn-vote-success {
  background: linear-gradient(135deg, #b2f2bb, #8ce99a);
  color: #155724;
  box-shadow: 0 4px 12px rgba(140, 233, 154, 0.3);
  border: 1px solid #8ce99a;
}

.btn-vote-success:hover {
  background: linear-gradient(135deg, #a9eab0, #74d99f);
  box-shadow: 0 6px 18px rgba(116, 217, 159, 0.4);
  transform: translateY(-2px);
}

.btn-vote-info {
  background: linear-gradient(135deg, #a5d8ff, #74c0fc);
  color: #084298;
  box-shadow: 0 4px 12px rgba(116, 192, 252, 0.3);
  border: 1px solid #74c0fc;
}

.btn-vote-info:hover {
  background: linear-gradient(135deg, #91c7f5, #5ca9e6);
  box-shadow: 0 6px 18px rgba(92, 169, 230, 0.4);
  transform: translateY(-2px);
}

.vote-btn:disabled {
  opacity: 0.6;
  pointer-events: none;
  cursor: default;
}

.alert-warning {
  background: #fff7db;
  color: #9a7500;
  border-radius: 12px;
  padding: 16px 24px;
  max-width: 700px;
  margin: 30px auto 20px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(154, 117, 0, 0.15);
}

#theme-title {
  font-size: 1.9rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

@media (max-width: 600px) {
  .fact-card {
    padding: 32px 10px;
  }

  .fact {
    font-size: 1.5rem;
  }

  .btn-vote-success,
  .btn-vote-info {
    width: 100%;
    max-width: 100%;
    font-size: 16px;
    padding: 14px 0;
  }

  #change-theme-btn {
    width: 100%;
    max-width: 240px;
  }
}

#login-form {
  max-width: 400px;
  margin: 20px auto;
  padding: 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
}

.btn-retour {
  position: absolute;
  top: 15px;
  left: 15px;
  font-size: 14px;
  color: #666;
  background: transparent;
  border: none;
  padding: 4px 10px;
  transition: color 0.3s, transform 0.2s;
}

.btn-retour:hover {
  color: #333;
  transform: translateX(-3px);
}

.theme-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  padding: 10px;
}

.theme-btn {
  padding: 12px 22px;
  border: none;
  background: linear-gradient(145deg, #e0eafc, #cfdef3);
  color: #1e3a5f;
  font-weight: 600;
  font-size: 15px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.25s ease-in-out;
  cursor: pointer;
  user-select: none;
}

.theme-btn:hover {
  background: linear-gradient(145deg, #c2d6f3, #b5d0f1);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.theme-btn.selected {
  background: linear-gradient(145deg, #1e90ff, #1c7ed6);
  color: white;
  box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.3);
}

.header-icon-btn {
  position: relative;
  background: none;
  border: none;
  padding: 0;
  margin: 0 6px;
  font-size: 18px;
}

.header-icon-btn i {
  font-size: 18px;
}

.header-icon-btn .badge {
  font-size: 10px;
  padding: 4px 6px;
}

.return-theme-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  text-decoration: underline;
  cursor: pointer;
  margin: 0 auto 24px auto;
  text-align: center;
}

.return-theme-link:hover {
  color: #000;
  text-decoration: none;
}

.site-tagline {
  font-size: 0.9rem;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

