/* ==========================================================================
   Quizy — feuille de style unique
   Thèmes : "admin" (clair, pour créer) et "game" (violet, pour jouer)
   ========================================================================== */

:root {
  --violet-950: #1e0a4a;
  --violet-900: #2e1065;
  --violet-800: #4c1d95;
  --violet-700: #6d28d9;
  --violet-600: #7c3aed;
  --violet-100: #ede9fe;
  --violet-50: #f5f3ff;
  --ink: #1f1637;
  --ink-soft: #5b5473;
  --line: #e4def5;
  --white: #fff;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --ko: #b91c1c;
  --ko-bg: #fee2e2;
  --amber: #f59e0b;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(46, 16, 101, .12);

  /* Couleurs + formes des réponses (lisibles même sans couleur) */
  --c0: #d6213f;
  --c1: #1b66c9;
  --c2: #b87400;
  --c3: #20842a;
  --c4: #7e3fd1;
  --c5: #0d8587;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--violet-50);
  min-height: 100vh;
  min-height: 100dvh;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.noscript { padding: 2rem; text-align: center; font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---------- Marque ---------- */
.brand {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 800; font-size: 1.6rem; letter-spacing: -.02em;
  color: inherit; text-decoration: none;
}
.brand svg { width: 1.9rem; height: 1.9rem; flex: none; }
.brand b { color: var(--amber); font-weight: 800; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 0; border-radius: 12px; padding: .7rem 1.2rem; min-height: 2.9rem;
  font-weight: 700; text-decoration: none; text-align: center;
  background: var(--violet-700); color: #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .18);
  transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .18); }
.btn[disabled] { opacity: .5; cursor: not-allowed; filter: none; }
.btn.sec { background: #fff; color: var(--violet-800); border: 2px solid var(--line); box-shadow: none; }
.btn.sec:hover { border-color: var(--violet-600); }
.btn.danger { background: #fff; color: var(--ko); border: 2px solid #f3c1c1; box-shadow: none; }
.btn.danger:hover { background: var(--ko-bg); }
.btn.go { background: var(--amber); color: #2a1a00; }
.btn.big { font-size: 1.25rem; padding: .9rem 2rem; min-height: 3.4rem; }
.btn.small { padding: .35rem .8rem; min-height: 2.2rem; font-size: .9rem; border-radius: 10px; }
.btn.ghost { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; }

/* ---------- Formulaires ---------- */
.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field > label, .label { font-weight: 700; font-size: .92rem; color: var(--ink-soft); }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: .7rem .85rem; border-radius: 12px;
  border: 2px solid var(--line); background: #fff; min-height: 2.9rem;
}
textarea { resize: vertical; min-height: 4.2rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet-600); box-shadow: 0 0 0 3px rgba(124, 58, 237, .18); }
.hint { color: var(--ink-soft); font-size: .9rem; }
.error-msg { background: var(--ko-bg); color: var(--ko); border-radius: 10px; padding: .6rem .9rem; font-weight: 600; margin-bottom: 1rem; }

/* ---------- Mise en page admin ---------- */
.shell { max-width: 960px; margin: 0 auto; padding: 1.2rem 1rem 4rem; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.topbar .brand { color: var(--violet-800); }
.topbar .brand b { color: var(--violet-600); }
.topbar nav { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 2rem 0 .8rem; }
.section-title h2 { margin: 0; font-size: 1.25rem; }
.list { display: grid; gap: .8rem; }
.row { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.row .grow { flex: 1 1 14rem; min-width: 0; }
.row h3 { margin: 0; font-size: 1.08rem; overflow-wrap: anywhere; }
.row .meta { color: var(--ink-soft); font-size: .88rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.empty { text-align: center; color: var(--ink-soft); padding: 2rem 1rem; border: 2px dashed var(--line); border-radius: var(--radius); }
.tag { display: inline-block; padding: .1rem .6rem; border-radius: 99px; font-size: .78rem; font-weight: 700; background: var(--violet-100); color: var(--violet-800); }
.tag.live { background: var(--ok-bg); color: var(--ok); }

.auth-card { max-width: 26rem; margin: 8vh auto 0; }
.auth-card .brand { color: var(--violet-800); margin-bottom: 1rem; font-size: 2rem; }
.auth-card .brand b { color: var(--violet-600); }

/* ---------- Éditeur ---------- */
.editor-bar {
  position: sticky; top: 0; z-index: 20; background: rgba(245, 243, 255, .94); backdrop-filter: blur(6px);
  display: flex; gap: .7rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: .7rem 0; border-bottom: 1px solid var(--line); margin-bottom: 1.2rem;
}
.save-state { font-size: .9rem; color: var(--ink-soft); }
.save-state.dirty { color: #b45309; font-weight: 700; }
.q-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.q-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .8rem; }
.q-num { background: var(--violet-700); color: #fff; font-weight: 800; border-radius: 10px; min-width: 2.2rem; text-align: center; padding: .25rem .5rem; }
.q-head select { width: auto; flex: 1 1 11rem; }
.q-tools { display: flex; gap: .3rem; margin-left: auto; }
.icon-btn { border: 2px solid var(--line); background: #fff; border-radius: 10px; width: 2.4rem; height: 2.4rem; display: inline-grid; place-items: center; font-size: 1rem; }
.icon-btn:hover { border-color: var(--violet-600); }
.icon-btn[disabled] { opacity: .35; cursor: not-allowed; }
.opt-row { display: flex; align-items: center; gap: .55rem; margin-bottom: .5rem; }
.opt-row .shape { width: 2.4rem; height: 2.9rem; border-radius: 10px; color: #fff; display: grid; place-items: center; font-size: 1.1rem; flex: none; }
.opt-row input[type=text] { flex: 1; }
.opt-row .mark { width: 1.5rem; height: 1.5rem; accent-color: var(--ok); flex: none; cursor: pointer; }
.opt-row.right input[type=text] { border-color: var(--ok); background: #f0fdf4; }
.q-settings { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .9rem; }
.q-settings .field { margin: 0; flex: 1 1 10rem; }
.add-q { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: 1.2rem; }

/* ---------- Image d'une question (éditeur) ---------- */
.img-row { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin: 0 0 1rem; }
.q-thumb { width: 8.5rem; max-height: 6rem; object-fit: cover; border-radius: 10px; border: 2px solid var(--line); background: var(--violet-50); }
.img-tools { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* ---------- Pastilles de réponse (couleurs + formes) ---------- */
.c0 { --c: var(--c0); } .c1 { --c: var(--c1); } .c2 { --c: var(--c2); }
.c3 { --c: var(--c3); } .c4 { --c: var(--c4); } .c5 { --c: var(--c5); }
.shape { background: var(--c); }

/* ==========================================================================
   Thème "jeu" : participants + écran de l'animateur
   ========================================================================== */
body.game {
  color: #fff;
  background: radial-gradient(1200px 700px at 80% -10%, #7c3aed 0, transparent 60%),
              linear-gradient(165deg, var(--violet-900), var(--violet-800) 55%, #5b21b6);
  background-attachment: fixed;
}
body.game .brand b { color: var(--amber); }

/* Accueil */
.home { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; }
.home-box { width: min(26rem, 100%); text-align: center; }
.home .brand { font-size: 3rem; margin-bottom: .3rem; }
.home .brand svg { width: 3.2rem; height: 3.2rem; }
.tagline { opacity: .85; margin: 0 0 1.6rem; }
.panel { background: #fff; color: var(--ink); border-radius: 18px; padding: 1.3rem; box-shadow: 0 14px 40px rgba(0, 0, 0, .28); text-align: left; }
.panel .field > label { color: var(--ink-soft); }
.code-input { text-align: center; font-size: 2rem; letter-spacing: .35em; font-weight: 800; padding-left: .35em; }
.foot-link { margin-top: 1.4rem; font-size: .9rem; opacity: .8; }
.foot-link a { color: #fff; }

/* Participant */
.q-img { display: block; max-width: 100%; max-height: 25dvh; margin: 0 auto .6rem; border-radius: 10px; object-fit: contain; }
.player { min-height: 100dvh; display: flex; flex-direction: column; padding: .8rem .9rem calc(1rem + env(safe-area-inset-bottom)); max-width: 40rem; margin: 0 auto; }
.p-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; font-weight: 700; font-size: .95rem; min-height: 2.2rem; }
.p-top .chip { background: rgba(255, 255, 255, .16); border-radius: 99px; padding: .2rem .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.p-main { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1rem; padding: .8rem 0; }
.center { text-align: center; }
.big-emoji { font-size: 4.2rem; line-height: 1; margin-bottom: .4rem; }
.p-title { font-size: 1.7rem; font-weight: 800; margin: 0; }
.p-sub { opacity: .85; margin: .3rem 0 0; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .6; transform: scale(.97); } }

.q-box { background: #fff; color: var(--ink); border-radius: 16px; padding: .9rem 1rem; font-weight: 700; font-size: 1.2rem; text-align: center; overflow-wrap: anywhere; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }
.timer { display: flex; align-items: center; gap: .7rem; }
.timer .num { font-weight: 800; font-size: 1.5rem; min-width: 2.6rem; text-align: center; font-variant-numeric: tabular-nums; }
.bar { flex: 1; height: .8rem; background: rgba(255, 255, 255, .2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 100%; background: var(--amber); border-radius: 99px; transform-origin: left; transition: width .12s linear; }
.bar.low > i { background: #ff5a5a; }

.opts { display: grid; gap: .65rem; grid-template-columns: 1fr 1fr; }
.opts.one { grid-template-columns: 1fr; }
.opt {
  position: relative; display: flex; align-items: center; gap: .7rem; text-align: left;
  min-height: 4.6rem; border: 0; border-radius: 14px; padding: .7rem .9rem;
  background: var(--c); color: #fff; font-weight: 700; font-size: 1.05rem;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .25); overflow-wrap: anywhere;
  transition: transform .08s, opacity .2s, filter .2s;
}
.opt .sym { font-size: 1.5rem; flex: none; width: 1.8rem; text-align: center; }
.opt .txt { flex: 1; }
.opt:active:not([disabled]) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.opt[disabled] { cursor: default; }
.opt.picked { outline: 4px solid #fff; outline-offset: 2px; }
.opt.dim { opacity: .28; filter: grayscale(.4); }
.opt.right { outline: 4px solid #fff; outline-offset: 2px; }
.opt.right::after { content: "✓"; position: absolute; right: .7rem; top: .4rem; font-size: 1.6rem; font-weight: 800; }
.opt .count { margin-left: auto; font-weight: 800; font-size: 1.2rem; background: rgba(0, 0, 0, .25); border-radius: 10px; padding: .1rem .55rem; flex: none; }
.opt.right .count { margin-right: 2rem; }
.opt.toggle .sym::before { content: "☐"; }
.opt.toggle.picked .sym::before { content: "☑"; }
.opt.toggle .sym { font-size: 0; }
.opt.toggle .sym::before { font-size: 1.6rem; }

.result { border-radius: 18px; padding: 1.2rem; text-align: center; color: #fff; }
.result.good { background: linear-gradient(160deg, #16a34a, #15803d); }
.result.bad { background: linear-gradient(160deg, #dc2626, #b91c1c); }
.result.none { background: rgba(255, 255, 255, .16); }
.result .r-title { font-size: 1.8rem; font-weight: 800; }
.result .r-pts { font-size: 1.3rem; font-weight: 700; margin-top: .2rem; }
.rank-line { background: rgba(255, 255, 255, .14); border-radius: 14px; padding: .8rem 1rem; display: flex; justify-content: space-between; font-weight: 700; }
.rank-line b { font-size: 1.15rem; }
.correct-list { background: rgba(255, 255, 255, .14); border-radius: 14px; padding: .7rem 1rem; }
.correct-list .label { color: rgba(255, 255, 255, .75); }
.banner { position: fixed; left: 0; right: 0; top: 0; z-index: 50; background: #b91c1c; color: #fff; text-align: center; padding: .45rem; font-weight: 700; font-size: .9rem; }
.waiting-dots::after { content: ""; animation: dots 1.4s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* Podium + classement */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: .6rem; margin: 1rem 0; min-height: 13rem; }
.podium .step { flex: 1; max-width: 9.5rem; text-align: center; }
.podium .step .who { font-weight: 800; overflow-wrap: anywhere; margin-bottom: .3rem; }
.podium .step .pts { font-size: .9rem; opacity: .85; margin-bottom: .3rem; }
.podium .block { border-radius: 12px 12px 0 0; display: grid; place-items: center; font-size: 2.2rem; font-weight: 800; background: rgba(255, 255, 255, .2); }
.podium .p1 .block { height: 9rem; background: linear-gradient(180deg, #fcd34d, #f59e0b); color: #3b2300; }
.podium .p2 .block { height: 6.5rem; background: linear-gradient(180deg, #e5e7eb, #9ca3af); color: #1f2937; }
.podium .p3 .block { height: 4.8rem; background: linear-gradient(180deg, #fdba74, #c2410c); color: #3b1700; }
.board { display: grid; gap: .45rem; }
.board .line { display: flex; align-items: center; gap: .8rem; background: rgba(255, 255, 255, .13); border-radius: 12px; padding: .5rem .9rem; font-weight: 700; }
.board .line .rk { width: 2rem; text-align: center; opacity: .85; }
.board .line .nm { flex: 1; overflow-wrap: anywhere; }
.board .line .sc { font-variant-numeric: tabular-nums; }
.board .line.me { background: rgba(251, 191, 36, .28); outline: 2px solid var(--amber); }

/* ==========================================================================
   Écran de l'animateur / projection
   ========================================================================== */
.host { min-height: 100dvh; display: flex; flex-direction: column; }
.h-top { display: flex; align-items: center; gap: 1rem; padding: .8rem 1.4rem; flex-wrap: wrap; }
.h-top .spacer { flex: 1; }
.h-top .title { font-weight: 700; opacity: .9; overflow-wrap: anywhere; }
.pill { background: rgba(255, 255, 255, .16); border-radius: 99px; padding: .25rem .9rem; font-weight: 700; white-space: nowrap; }
.h-stage { flex: 1; padding: 0 1.4rem 1.2rem; display: flex; flex-direction: column; gap: 1.1rem; justify-content: center; max-width: 90rem; width: 100%; margin: 0 auto; }
.h-controls { position: sticky; bottom: 0; display: flex; justify-content: center; align-items: center; gap: .8rem; padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom)); background: rgba(30, 10, 74, .88); backdrop-filter: blur(8px); flex-wrap: wrap; }
.h-controls .info { opacity: .85; font-weight: 600; }

.join-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.join-card { background: #fff; color: var(--ink); border-radius: 20px; padding: 1.6rem; text-align: center; box-shadow: 0 14px 40px rgba(0, 0, 0, .3); }
.join-card .where { color: var(--ink-soft); font-size: 1.05rem; word-break: break-all; }
.join-card .where b { color: var(--violet-800); }
.big-code { font-size: clamp(2.8rem, 8vw, 5.5rem); font-weight: 800; letter-spacing: .12em; color: var(--violet-800); line-height: 1.1; font-variant-numeric: tabular-nums; margin: .3rem 0; }
.qr { width: min(15rem, 55%); aspect-ratio: 1; margin: .8rem auto 0; display: block; }
.qr svg { display: block; width: 100%; height: 100%; border-radius: 10px; }
.who-list { display: flex; flex-wrap: wrap; gap: .5rem; align-content: flex-start; }
.who-chip { display: inline-flex; align-items: center; gap: .4rem; background: rgba(255, 255, 255, .17); border-radius: 99px; padding: .3rem .4rem .3rem .95rem; font-weight: 700; animation: pop .25s ease-out; }
.who-chip button { border: 0; background: rgba(0, 0, 0, .25); color: #fff; width: 1.6rem; height: 1.6rem; border-radius: 50%; line-height: 1; }
.who-chip.ro { padding-right: .95rem; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.h-qbox { background: #fff; color: var(--ink); border-radius: 20px; padding: 1.3rem 1.8rem; font-weight: 800; font-size: clamp(1.5rem, 3.4vw, 2.7rem); text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); overflow-wrap: anywhere; }
.h-qbox.has-img { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 1.6rem; align-items: center; text-align: left; }
.h-qbox .h-img { display: block; width: 100%; max-height: 34vh; object-fit: contain; border-radius: 12px; }
.h-qbox.small .h-img { max-height: 24vh; }
.h-qbox .h-qtext { overflow-wrap: anywhere; }
.h-qmeta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.h-qmeta .timer { flex: 1; min-width: 12rem; }
.h-qmeta .timer .num { font-size: 2.4rem; }
.h-qmeta .bar { height: 1.1rem; }
.h-opts { display: grid; gap: .9rem; grid-template-columns: 1fr 1fr; }
.h-opts .opt { min-height: 6.2rem; font-size: clamp(1.1rem, 2.2vw, 1.8rem); padding: 1rem 1.3rem; cursor: default; }
.h-opts .opt .sym { font-size: 2rem; width: 2.4rem; }
.h-opts .opt.right::after { font-size: 2.2rem; top: .6rem; right: 1rem; }
.h-opts .opt .count { font-size: 1.6rem; }
.h-opts .fill { position: absolute; left: 0; bottom: 0; height: .5rem; background: rgba(255, 255, 255, .85); border-radius: 0 6px 0 14px; transition: width .5s; }
.h-side { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.h-side h3 { margin: 0 0 .6rem; font-size: 1.1rem; opacity: .9; }
.answered-count { font-weight: 700; font-size: 1.15rem; }
.final-wrap { display: grid; gap: 1rem; }
.final-wrap .board { max-width: 40rem; margin: 0 auto; width: 100%; }
.h-title-big { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; text-align: center; margin: 0; }

body.screen .h-controls { display: none; }
body.screen .who-chip button { display: none; }
body.screen .who-chip { padding-right: .95rem; }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 100; }
.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 90; background: var(--ink); color: #fff; border-radius: 12px; padding: .7rem 1.1rem; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100vw - 2rem); }
.toast.error { background: var(--ko); }

/* ---------- Adaptation aux petits écrans ---------- */
@media (max-width: 760px) {
  .join-grid, .h-side { grid-template-columns: 1fr; }
  .h-opts { grid-template-columns: 1fr; }
  .h-qbox.has-img { grid-template-columns: 1fr; text-align: center; }
  .h-top { padding: .6rem .9rem; }
  .h-stage { padding: 0 .9rem 1rem; }
  .opts { grid-template-columns: 1fr 1fr; }
  .q-tools { margin-left: 0; }
}
@media (max-width: 380px) {
  .opts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print { .editor-bar, .actions, .topbar nav { display: none; } }

/* ---------- Quiz surprise (v1.3) ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .5rem; }
.theme-pick { display: flex; align-items: center; gap: .55rem; padding: .55rem .8rem; border: 2px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-weight: 600; color: var(--ink); }
.theme-pick:has(input:checked) { border-color: var(--violet-600); background: var(--violet-50); }
.theme-pick input { width: 1.15rem; height: 1.15rem; accent-color: var(--violet-600); flex: none; }
.theme-pick .tp-emoji { font-size: 1.3rem; flex: none; }
.theme-pick .tp-name { overflow-wrap: anywhere; line-height: 1.2; }
.theme-tools { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .4rem; }
.linklike { border: 0; background: none; padding: .2rem 0; color: var(--violet-700); font-weight: 700; text-decoration: underline; cursor: pointer; }
.draw-veil { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; background: rgba(30, 10, 74, .94); color: #fff; text-align: center; padding: 1rem; }
.draw-veil .hint { color: rgba(255, 255, 255, .8); }
.draw-dice { font-size: 5rem; animation: roll 0.9s ease-in-out infinite; }
.draw-text { font-size: 1.6rem; font-weight: 800; }
@keyframes roll { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(1.2); } 100% { transform: rotate(360deg) scale(1); } }

/* Explication affichée avec la correction */
.explain { background: rgba(255, 255, 255, .16); border-radius: 14px; padding: .8rem 1rem; font-weight: 600; line-height: 1.35; text-align: center; overflow-wrap: anywhere; }
.h-explain { background: rgba(255, 255, 255, .16); border-radius: 16px; padding: .9rem 1.4rem; font-weight: 700; font-size: clamp(1.1rem, 2vw, 1.6rem); text-align: center; overflow-wrap: anywhere; }

/* Revue des questions après la partie */
.review { display: grid; gap: .7rem; width: min(52rem, 100%); margin: 0 auto; text-align: left; }
.review .rq { background: #fff; color: var(--ink); border-radius: 14px; padding: .8rem 1rem; }
.review .rq h4 { margin: 0 0 .4rem; font-size: 1.05rem; overflow-wrap: anywhere; }
.review .rq .good { color: var(--ok); font-weight: 800; }
.review .rq .wrong { color: var(--ink-soft); }
.review .rq .why { margin-top: .35rem; color: var(--ink-soft); font-size: .92rem; }

/* ---------- Enchaînement automatique, emoji et crédits photo (v1.4) ---------- */
.next-wrap { display: grid; gap: .45rem; text-align: center; font-weight: 700; }
.next-wrap .bar { height: .6rem; }
.next-num { font-variant-numeric: tabular-nums; }
.h-stage .next-wrap { font-size: 1.15rem; width: min(34rem, 100%); margin: 0 auto; }
.q-emoji { font-size: 3.2rem; line-height: 1.1; margin-bottom: .2rem; }
.q-credit, .h-credit { font-size: .72rem; font-weight: 500; opacity: .65; text-align: center; margin: -.3rem 0 .4rem; }
.h-qbox.has-img .h-credit { grid-column: 1 / -1; text-align: right; margin: 0; }
.h-qbox.has-emoji { display: grid; justify-items: center; gap: .4rem; }
.h-emoji { font-size: clamp(3rem, 8vh, 5.5rem); line-height: 1.05; }
.h-qbox.has-emoji.small .h-emoji { font-size: clamp(2.2rem, 5vh, 3.2rem); }
.review .rq .rq-fig { margin: 0 0 .5rem; }
.review .rq .rq-fig img { display: block; max-width: 100%; max-height: 11rem; border-radius: 8px; }
.review .rq .rq-fig figcaption { font-size: .75rem; color: var(--ink-soft); }
.ai-box { background: var(--violet-50); border: 2px solid var(--violet-100); border-radius: 12px; padding: .8rem 1rem; }
.seg { display: inline-flex; border: 2px solid var(--violet-600); border-radius: 12px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: .55rem 1rem; font-weight: 700; color: var(--violet-700); cursor: pointer; min-height: 2.6rem; }
.seg button.on { background: var(--violet-600); color: #fff; }
.check-line { display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.check-line input { width: 1.15rem; height: 1.15rem; accent-color: var(--violet-600); flex: none; }
