/* GLOBAL & RESET */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden; /* Empêche le scroll horizontal */
  min-height: 100vh;
  background: #fafafa;
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Centre verticalement */
  align-items: center;
}

/* AdSense blocks */
.ad {
  width: 100%;
  max-width: 360px;
  background: #f0f0f0;
  color: #888;
  font-size: 12px;
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  margin: 8px 0;
}

/* Container central */
.container {
  background: #fff;
  width: 100%;
  max-width: 360px;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  text-align: center;
  overflow: hidden; /* Pas de débordement interne */
}

/* Utility */
.hidden { display: none; }

h1 {
  font-size: 24px;
  font-weight: 600;
  color: #222;
  margin-bottom: 16px;
}

#progress {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
}

/* Buttons */
button.btn {
  display: block;
  width: 100%;
  font-size: 16px;
  padding: 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s;
  margin-top: 16px;
}

button.btn:hover {
  transform: scale(1.03);
}

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

button.primary {
  background-color: #007aff;
  color: #fff;
}

button.secondary {
  background-color: #e0e0e0;
  color: #333;
}

/* Quiz */
#quiz h2 {
  font-size: 18px;
  color: #333;
  margin-bottom: 16px;
}

.option-btn {
  width: 100%;
  background: #f9f9f9;
  color: #333;
  padding: 12px;
  border-radius: 8px;
  text-align: left;
  border: 1px solid #e0e0e0;
  margin-bottom: 8px;
  transition: background-color 0.2s, transform 0.2s;
}

.option-btn:hover {
  background: #eaeaea;
  transform: scale(1.01);
}

/* Résultat */
.score-box {
  position: relative;
  margin: 20px 0;
}

#animated-score {
  font-size: 48px;
  font-weight: 700;
  color: #222;
}

.badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff9500;
  color: #fff;
  padding: 6px 10px;
  border-radius: 50px;
  font-size: 12px;
  opacity: 0;
  transform: scale(0);
}

/* Animations */
@keyframes badge-pop {
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes score-count {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

#message-text {
  font-size: 16px;
  color: #555;
  margin-bottom: 16px;
}

/* Responsive ultra small */
@media (max-width: 320px) {
  .container {
    padding: 16px;
  }
  h1 {
    font-size: 20px;
  }
  #animated-score {
    font-size: 36px;
  }
}