:root {
  --bg1: #0f0c29;
  --bg2: #302b63;
  --bg3: #24243e;
  --accent: #ff5da2;
  --accent2: #7c6cff;
  --accent3: #33d9c9;
  --ok: #2ee6a6;
  --ko: #ff5b6e;
  --text: #ffffff;
  --muted: rgba(255,255,255,0.65);
  --glass: rgba(255,255,255,0.07);
  --glass-border: rgba(255,255,255,0.14);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%, rgba(124,108,255,0.35), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(255,93,162,0.30), transparent 45%),
    linear-gradient(160deg, var(--bg1), var(--bg3) 55%, var(--bg2));
  background-attachment: fixed;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { text-align: center; margin: 0.35em 0; letter-spacing: 0.01em; }
h1 { font-size: 1.8em; font-weight: 800; text-shadow: 0 2px 14px rgba(0,0,0,0.35); }
h2 { font-weight: 700; }
p { line-height: 1.5; }
a { text-decoration: none; }

.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 640px;
  margin: 12px 0;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
  animation: fadeInUp 0.35s ease both;
}

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

.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  border: none;
  border-radius: 14px;
  padding: 14px 24px;
  font-size: 1.02em;
  font-weight: 700;
  cursor: pointer;
  margin: 6px;
  box-shadow: 0 6px 18px rgba(124,108,255,0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(124,108,255,0.45); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn.secondary { background: linear-gradient(135deg, var(--accent3), var(--accent2)); box-shadow: 0 6px 18px rgba(51,217,201,0.3); }
.btn.ghost { background: rgba(255,255,255,0.10); box-shadow: none; border: 1px solid var(--glass-border); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

input:not([type=radio]):not([type=checkbox]), select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.9);
  color: #1a1a2e;
  font-size: 1em;
  margin: 6px 0;
}
input[type=radio], input[type=checkbox] {
  width: 18px;
  height: 18px;
  margin: 6px 0;
}
input::placeholder { color: #6b6b80; }
label { display: block; font-size: 0.88em; color: var(--muted); margin-top: 10px; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; max-width: 700px; }
@media (max-width: 480px) { .choices { grid-template-columns: 1fr; } }

.choice-btn {
  padding: 22px 18px;
  border-radius: 16px;
  border: none;
  font-size: 1.12em;
  font-weight: 700;
  color: white;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.choice-btn:not(:disabled):hover { transform: translateY(-3px) scale(1.01); filter: brightness(1.08); }
.choice-btn:not(:disabled):active { transform: translateY(0) scale(0.98); }
.choice-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.choice-btn .choice-image { width: 100%; max-height: 160px; object-fit: cover; border-radius: 10px; }

/* Bloc intitulé : encadré distinct pour ne pas le confondre avec les réponses ci-dessous */
.prompt-block {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 18px;
  margin: 10px 0 18px;
}
.prompt-image {
  display: block; max-width: 100%; max-height: 280px; margin: 10px auto 0;
  border-radius: 14px; border: 3px solid var(--accent2);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* Séparateur "Réponses" au-dessus des choix */
.choices-label {
  display: flex; align-items: center; gap: 10px;
  text-align: center; text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.8em; font-weight: 700; color: var(--muted);
  margin: 4px 0 12px;
}
.choices-label::before, .choices-label::after {
  content: ''; flex: 1; height: 1px; background: var(--glass-border);
}
.choice-0 { background: linear-gradient(135deg, #e21b3c, #b3122c); }
.choice-1 { background: linear-gradient(135deg, #1368ce, #0d4a99); }
.choice-2 { background: linear-gradient(135deg, #eab000, #c78e00); }
.choice-3 { background: linear-gradient(135deg, #26890c, #1c6609); }
.choice-btn.correct { outline: 4px solid var(--ok); box-shadow: 0 0 0 4px rgba(46,230,166,0.25), 0 8px 20px rgba(0,0,0,0.25); }
.choice-btn.incorrect { outline: 4px solid var(--ko); opacity: 0.55; }

.slider-wrap { width: 100%; max-width: 500px; margin: 18px auto 0; text-align: center; }
.slider-value { font-size: 2.6em; font-weight: 800; margin-bottom: 10px; text-shadow: 0 2px 14px rgba(0,0,0,0.35); }
.slider-wrap input[type=range] {
  width: 100%;
  accent-color: var(--accent2);
  margin: 10px 0 18px;
}

.timer-bar-wrap { width: 100%; max-width: 700px; height: 16px; background: rgba(255,255,255,0.12); border-radius: 10px; overflow: hidden; margin: 14px 0; border: 1px solid var(--glass-border); }
.timer-bar { height: 100%; background: linear-gradient(90deg, var(--accent3), var(--accent2)); width: 100%; transition: width 0.2s linear, background 0.3s ease; }
.timer-bar.warn { background: linear-gradient(90deg, #ffce45, #ff9a3d); }
.timer-bar.danger { background: linear-gradient(90deg, #ff5b6e, #ff2e50); }

.participants-list { list-style: none; padding: 0; margin: 0; width: 100%; }
.participants-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: 12px; margin-bottom: 8px;
}
.badge { background: rgba(255,255,255,0.16); border-radius: 20px; padding: 3px 12px; font-size: 0.85em; font-weight: 600; }

.center { text-align: center; }
.row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
table { width: 100%; border-collapse: collapse; }
td, th { padding: 10px 8px; border-bottom: 1px solid var(--glass-border); text-align: left; }
.muted { opacity: 0.75; font-size: 0.92em; color: var(--muted); }

/* Podium (écran de fin) */
.podium {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 14px; width: 100%; max-width: 560px; margin: 20px auto 8px;
}
.podium-slot { flex: 1; text-align: center; display: flex; flex-direction: column; align-items: center; }
.podium-avatar {
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.3em; margin-bottom: 8px;
  background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.4);
}
.podium-name { font-weight: 700; margin-bottom: 4px; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-score { font-size: 0.85em; color: var(--muted); margin-bottom: 8px; }
.podium-bar {
  width: 100%; border-radius: 12px 12px 0 0;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 8px;
  font-size: 1.6em;
}
.podium-slot.first .podium-bar { height: 130px; background: linear-gradient(180deg, #ffd75e, #e6ab00); }
.podium-slot.second .podium-bar { height: 95px; background: linear-gradient(180deg, #d9dee6, #a9b2bd); order: -1; }
.podium-slot.third .podium-bar { height: 70px; background: linear-gradient(180deg, #e2a469, #b97a3c); order: 1; }
.podium-slot.first { order: 0; }
.podium-slot.second { order: -1; }
.podium-slot.third { order: 1; }

@keyframes popIn {
  from { opacity: 0; transform: scale(0.85) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.podium-slot { animation: popIn 0.5s ease both; }
.podium-slot.second { animation-delay: 0.05s; }
.podium-slot.third { animation-delay: 0.15s; }
