:root {
  --bg:#f4f6fa;
  --card:#fff;
  --text:#333;
  --muted:#666;
  --brand:#2a5298;
  --brand-strong:#1e3c72;
  --chip:#f9f9f9;
  --chip-border:#cfd6e4;
  --chip-hover:#eef3fc;
  --danger:#e74c3c;
  --success-bg:#d4f8d4;
  --success-bd:#2ecc71;
  --success-tx:#2c662d;
  --shadow:0 6px 15px rgba(0,0,0,0.1);
    --nb-emotions-par-ligne: 4;
    --nb-cartes-par-ligne: 2;
}

body {
  margin: 0;
  background: var(--bg);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
}

.hero {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: white;
  text-align: center;
  padding: 30px 16px;
}

.hero h1 { margin:0; font-size: clamp(1.4rem, 2.5vw, 2.2rem); }
.hero p { margin:10px 0 0; opacity:.95; }

.card {
  background: var(--card);
  max-width: 1100px;
  margin: 16px auto;
  padding: 16px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

#equipe {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: center;
}
#equipe select {
  padding: 10px 12px;
  border: 1px solid #d6dbe6;
  border-radius: 10px;
  font-size: 1rem;
}

.grid {
  max-width: 1200px;
  margin: 22px auto;
  padding: 0 14px;
  display: grid;
  gap: 18px;
  /*grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));*/
  grid-template-columns: repeat(var(--nb-cartes-par-ligne), minmax(280px, 1fr));
}

.q-card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.q-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2d3d;
  text-align: center;
}

.options {
  display: grid;
  grid-template-columns: repeat(var(--nb-emotions-par-ligne), 1fr); /* ✅ 2 colonnes fixes */
  gap: 10px;
}

.option {
  min-width: 0;        /* ✅ permet de se contraindre à la largeur dispo */
  max-width: 100%;     /* ✅ ne peut pas dépasser la cellule */
  justify-self: stretch; /* ✅ occupe toute la cellule de grille */
    padding: 10px 12px;
  text-align: center;
  border-radius: 10px;
  border: 2px solid var(--chip-border);
  background: var(--chip);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.option:hover { background: var(--chip-hover); border-color: var(--brand); }
.option.selected {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
  font-weight: bold;
}

.option .label {
  font-weight: 600;
  margin-bottom: 4px;
}

.option small.explication {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.2;
}


.q-card.missing { border: 2px solid var(--danger); }

.actions { text-align: center; margin: 20px 0; }
button {
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  background: var(--brand);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
button:hover { background: var(--brand-strong); }

#confirmation {
  display: none;
  margin: 10px auto 30px;
  max-width: 700px;
  padding: 12px;
  background: var(--success-bg);
  border: 1px solid var(--success-bd);
  border-radius: 10px;
  color: var(--success-tx);
  font-weight: 600;
  text-align: center;
}

@media (max-width: 665px) {
  #equipe { grid-template-columns: 1fr; }
  .option { flex: 1 1 100%; }
  :root {
    --nb-emotions-par-ligne: 2;
    --nb-cartes-par-ligne: 1;
  }
}

.explication {
    font-size:0.7em;
}

#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  min-width: 220px;
  padding: 12px 18px;
  border-radius: 8px;
  color: #fff;
  font-weight: 500;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateX(100%);
  animation: slideIn 0.3s forwards, fadeOut 0.3s ease 4.5s forwards;
}

.toast.error   { background: #e74c3c; }
.toast.info    { background: #3498db; }
.toast.success { background: #2ecc71; }

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}


#screen-info {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 0.9rem;
  padding: 8px;
  text-align: center;
  z-index: 99999;
  font-family: monospace;
}

