:root {
  --bg: #fff5f7;
  --bg2: #fde4ec;
  --card: #ffffff;
  --text: #2b1a22;
  --muted: #8a6b78;
  --accent: #e8436d;
  --accent2: #8b5cf6;
  --line: #f3d3de;
  --ok: #16a34a;
  --ko: #ea580c;
  --shadow: 0 10px 30px rgba(232, 67, 109, 0.12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1116;
    --bg2: #24131d;
    --card: #2a1b23;
    --text: #fbe9f0;
    --muted: #c19cad;
    --line: #47303b;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, var(--bg), var(--bg2)) fixed;
  min-height: 100vh;
  line-height: 1.45;
}
.wrap { max-width: 520px; margin: 0 auto; padding: 20px 16px 40px; }
h1, h2 { margin: 0 0 8px; line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.big { font-size: 1.3rem; font-weight: 700; }
.center { text-align: center; }
[hidden] { display: none !important; }

.hero { text-align: center; margin: 24px 0; }
.logo { font-size: 3rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

label { display: block; font-weight: 600; margin-bottom: 14px; }
input {
  display: block; width: 100%; margin-top: 6px;
  padding: 12px 14px; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--text);
}
input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.error { color: var(--ko); font-weight: 600; margin-top: 0; }

.btn {
  display: inline-block; border: 0; cursor: pointer;
  padding: 12px 20px; border-radius: 999px;
  font-size: 1rem; font-weight: 600; text-decoration: none;
  background: var(--line); color: var(--text);
  transition: transform 0.1s, opacity 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; width: 100%; }
.btn.small { padding: 8px 14px; font-size: 0.9rem; }
.btn.ghost { background: transparent; color: var(--muted); }
.link { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.foot { text-align: center; margin-top: 20px; }
.foot a { color: inherit; }

.steps { padding-left: 20px; }
.steps li { margin-bottom: 6px; }

/* Partie */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 8px; }
.players { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pill {
  background: var(--card); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pill.me { border-color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); opacity: 0.5; flex: none; }
.dot.on { background: var(--ok); opacity: 1; }
.score {
  font-weight: 700; padding: 6px 12px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; white-space: nowrap;
}

.share .linkbox { display: flex; gap: 8px; margin: 10px 0; }
.share .linkbox input { margin: 0; font-size: 0.85rem; }

.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width 0.4s; }
.counter { font-size: 0.85rem; margin: 8px 0 18px; }
.prefix { margin: 0; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.85rem; }
.question { font-size: 1.6rem; margin: 6px 0 22px; overflow-wrap: anywhere; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  border: 2px solid var(--line); background: var(--bg); color: var(--text);
  border-radius: 16px; padding: 18px 10px; font-size: 1.1rem; font-weight: 700;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
  overflow-wrap: anywhere; transition: transform 0.1s, border-color 0.2s, background 0.2s;
}
.choice small { font-weight: 500; font-size: 0.75rem; color: var(--muted); }
.choice.both { grid-column: 1 / -1; padding: 14px; }
.choice:not(:disabled):hover { border-color: var(--accent); }
.choice:active:not(:disabled) { transform: scale(0.97); }
.choice.selected { border-color: var(--accent); background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.choice.selected small { color: rgba(255, 255, 255, 0.85); }
.choice:disabled { cursor: default; }
.choice:disabled:not(.selected) { opacity: 0.45; }

.status { min-height: 1.4em; text-align: center; margin: 14px 0 0; }

.reveal { margin-top: 18px; padding: 16px; border-radius: 16px; background: var(--bg); border: 2px solid var(--ko); text-align: center; animation: pop 0.35s ease; }
.reveal.match { border-color: var(--ok); }
.verdict { font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; }
.answers div { margin: 4px 0; }
.who { font-weight: 700; }

.actions { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; }

.history { text-align: left; margin-top: 20px; }
.history summary { cursor: pointer; text-align: center; color: var(--muted); }
.history ul { list-style: none; padding: 0; }
.history li { padding: 10px 12px; border-left: 4px solid var(--ko); background: var(--bg); border-radius: 8px; margin: 8px 0; }
.history li.ok { border-left-color: var(--ok); }

.pop { animation: pop 0.35s ease; }
@keyframes pop {
  from { transform: scale(0.96); opacity: 0.4; }
  to { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .pop, .reveal { animation: none; }
}
