/* Application Quiz CoLean Académie : charte CoLean (Poppins, pétrole, vert, orange) */

@font-face { font-family: 'Poppins'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('../fonts/poppins-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-weight: 500; font-style: normal; font-display: swap;
  src: url('../fonts/poppins-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('../fonts/poppins-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('../fonts/poppins-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('../fonts/poppins-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('../fonts/poppins-latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --petrol: #107494; --ink: #0B3A4A; --green: #4DB350; --orange: #F58800; --red: #D32F2F; --grey: #C8CACC;
  --gain: #B8F4B8; --alert: #F29E9E; --sand: #EFCEAB; --info: #B0D9EA; --soft: #F2F8FB; --white: #FFFFFF;
  --radius: 16px;
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--white);
  -webkit-tap-highlight-color: transparent;
}
body.dark { background: var(--ink); color: var(--white); }
body.petrol { background: var(--petrol); color: var(--white); }
body.gain { background: var(--gain); }
body.alert { background: var(--alert); }
body.sand { background: var(--sand); }
body.info { background: var(--info); }
#app { flex: 1; display: flex; flex-direction: column; min-height: 0; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); color: var(--petrol); }
body.dark h1, body.petrol h1 { color: var(--white); }
h2 { font-size: clamp(1.25rem, 3vw, 1.7rem); }
p { margin: 0; }
a { color: var(--petrol); }
body.dark a, body.petrol a { color: var(--white); }
.just { text-align: justify; hyphens: none; -webkit-hyphens: none; }
.muted { opacity: .75; }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.spacer { height: 16px; }
.icon { display: inline-block; vertical-align: middle; flex: none; }

/* Pied de page : signature à gauche, lien à droite */
#foot {
  display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap;
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); font-size: .72rem; opacity: .8;
}
#foot a { text-decoration: none; font-weight: 600; }
body.gain #foot, body.alert #foot, body.sand #foot, body.info #foot { color: var(--ink); }
body.gain #foot a, body.alert #foot a, body.sand #foot a, body.info #foot a { color: var(--ink); }

/* Boutons */
.btn {
  appearance: none; border: 2px solid transparent; border-radius: 14px; padding: 12px 22px; cursor: pointer;
  font: 600 1rem/1.2 var(--font); display: inline-flex; gap: 10px; align-items: center; justify-content: center;
  transition: transform .12s ease, filter .12s ease, background-color .12s ease; text-decoration: none;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .opt:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.btn-primary { background: var(--orange); color: var(--ink); }
.btn-secondary { background: var(--petrol); color: var(--white); }
.btn-ghost { background: var(--white); color: var(--petrol); border-color: var(--petrol); }
body.dark .btn-ghost, body.petrol .btn-ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.7); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-big { font-size: 1.15rem; padding: 16px 32px; border-radius: 16px; }
.btn-small { padding: 8px 14px; font-size: .85rem; border-radius: 10px; }
.btn-icon { padding: 10px; border-radius: 12px; }

/* Champs */
label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; font: 500 1rem var(--font); color: var(--ink); background: var(--white);
  border: 2px solid var(--grey); border-radius: 12px; padding: 12px 14px;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { border-color: var(--petrol); outline: none; }
.field { margin-bottom: 16px; }
.pin-input { font-size: 2rem !important; text-align: center; letter-spacing: .3em; font-weight: 700 !important; }
.hint { font-size: .8rem; opacity: .75; margin-top: 6px; }
.error { background: var(--alert); color: var(--ink); border-radius: 12px; padding: 10px 14px; font-weight: 600; font-size: .92rem; }
.notice { background: var(--info); color: var(--ink); border-radius: 12px; padding: 10px 14px; font-size: .85rem; }

/* Cartes et pages */
.page { width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px 20px; flex: 1; }
.page-narrow { max-width: 460px; }
.card { background: var(--white); color: var(--ink); border: 1px solid var(--grey); border-radius: var(--radius); padding: 20px; }
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.brand img { height: 56px; width: auto; display: block; }
.brand .name { font-size: 1.3rem; font-weight: 700; color: var(--petrol); }
body.dark .brand .name, body.petrol .brand .name { color: var(--white); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--info); color: var(--ink); }

/* Écran d'accueil */
.hero { text-align: center; padding: 28px 0 8px; }
.hero p { margin-top: 10px; font-size: 1.05rem; }

/* ---------- Joueur ---------- */
.p-wrap { flex: 1; display: flex; flex-direction: column; padding: 18px 18px 8px; width: 100%; max-width: 640px; margin: 0 auto; }
.p-top { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: .9rem; margin-bottom: 12px; gap: 12px; }
.p-top .you { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; min-width: 0; flex: 1 1 auto; }
.p-top > :last-child { white-space: nowrap; flex: none; }
.p-center { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 14px; }
.big-name { font-size: clamp(1.8rem, 8vw, 2.6rem); font-weight: 700; word-break: break-word; }
.dots span { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: currentColor; margin: 0 4px; animation: bounce 1.2s infinite ease-in-out; }
.dots span:nth-child(2) { animation-delay: .15s; }
.dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }

.timebar { height: 12px; border-radius: 999px; background: rgba(255,255,255,.2); overflow: hidden; }
.timebar > div { height: 100%; width: 100%; background: var(--info); border-radius: 999px; transition: background-color .3s; }
.timebar.low > div { background: var(--orange); }
.qtext { font-size: clamp(1.15rem, 4.6vw, 1.5rem); font-weight: 600; line-height: 1.35; margin: 16px 0; }
.opts { display: grid; gap: 12px; margin-bottom: 14px; }
.opt {
  appearance: none; display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  background: var(--white); color: var(--ink); border: 3px solid transparent; border-radius: 16px; padding: 14px 16px;
  font: 600 1.05rem/1.3 var(--font); cursor: pointer; transition: transform .12s, opacity .2s, border-color .2s, background-color .2s;
  min-height: 64px;
}
.opt:active { transform: scale(.98); }
.badge { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; line-height: 1; }
.badge.l0 { background: var(--petrol); color: var(--white); }
.badge.l1 { background: var(--green); color: var(--ink); }
.badge.l2 { background: var(--orange); color: var(--ink); }
.badge.l3 { background: var(--ink); color: var(--white); }
.opt.chosen { border-color: var(--orange); }
.opt.faded { opacity: .35; }
.opt.right { background: var(--gain); border-color: var(--green); }
.opt.wrong { background: var(--alert); }
.opt .tick { margin-left: auto; flex: none; }
.sent { text-align: center; font-weight: 600; padding: 10px; }

.res-title { font-size: clamp(1.7rem, 8vw, 2.4rem); font-weight: 700; }
.res-points { font-size: clamp(1.4rem, 6vw, 2rem); font-weight: 700; }
.res-icon { color: var(--petrol); width: 84px; height: 84px; border-radius: 50%; background: var(--white); display: grid; place-items: center; animation: pop .4s ease-out; }
.shake { animation: shake .45s; }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.expl { background: var(--white); border-radius: 14px; padding: 14px 16px; font-size: .92rem; width: 100%; color: var(--ink); }
.expl b { display: block; margin-bottom: 4px; color: var(--petrol); }
.rank-card { background: rgba(255,255,255,.14); border-radius: 18px; padding: 16px 22px; min-width: 220px; }
.rank-card .rk { font-size: 3rem; font-weight: 700; line-height: 1; }

/* ---------- Animateur ---------- */
body.host { overflow-x: hidden; }
.h-wrap { flex: 1; display: flex; flex-direction: column; padding: 18px 28px 6px; width: 100%; max-width: 1500px; margin: 0 auto; }
.h-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; font-weight: 600; }
.h-top img { height: 44px; width: auto; display: block; }
.lobby { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 28px; flex: 1; align-items: start; }
.join-box { background: var(--white); color: var(--ink); border-radius: 22px; padding: 22px; text-align: center; }
.join-box .url { font-weight: 600; color: var(--petrol); font-size: 1rem; word-break: break-all; }
.join-box .pin { font-size: clamp(2.6rem, 6vw, 4.2rem); font-weight: 700; letter-spacing: .12em; line-height: 1.1; margin: 4px 0 10px; color: var(--ink); }
.join-box img.qr { width: 100%; max-width: 280px; height: auto; display: block; margin: 8px auto; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; }
.chip {
  background: var(--white); color: var(--ink); font-weight: 600; border-radius: 999px; padding: 8px 16px; animation: pop .3s ease-out;
  display: inline-flex; align-items: center; gap: 8px; font-size: 1rem;
}
.chip.off { opacity: .45; }
.chip button { appearance: none; border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0; opacity: .5; display: grid; place-items: center; }
.chip button:hover { opacity: 1; }
.team-col { margin-bottom: 14px; }
.team-col h3 { font-size: 1rem; margin-bottom: 8px; opacity: .85; }
.h-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.counter { font-size: 1.4rem; font-weight: 700; }

.h-q { flex: 1; display: flex; flex-direction: column; gap: 18px; }
.h-qtext { font-size: clamp(1.6rem, 3.6vw, 2.8rem); font-weight: 700; text-align: center; padding: 18px 12px; line-height: 1.25; }
.h-media { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.timer { position: relative; width: 112px; height: 112px; flex: none; }
.timer svg { transform: rotate(-90deg); }
.timer .t-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.2rem; font-weight: 700; }
.timer circle.bg { stroke: rgba(255,255,255,.2); }
.timer circle.fg { stroke: var(--info); transition: stroke .3s; }
.timer.low circle.fg { stroke: var(--orange); }
.answered { text-align: center; font-weight: 600; font-size: 1.1rem; }
.answered .big { font-size: 2.2rem; display: block; line-height: 1; }
.h-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: auto; padding-bottom: 8px; }
.h-opt { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; background: var(--white); color: var(--ink); border-radius: 18px; padding: 16px 20px; font-size: clamp(1.1rem, 2.2vw, 1.7rem); font-weight: 600; min-height: 92px; }
.h-opt .badge { width: 52px; height: 52px; font-size: 1.5rem; border-radius: 14px; }
.h-opt.right { background: var(--gain); }
.h-opt.faded { opacity: .6; }
.h-opt > * { position: relative; z-index: 1; }
.h-opt > .fill { position: absolute; z-index: 0; left: 0; top: 0; bottom: 0; width: 0; background: rgba(16,116,148,.2); transition: width .9s cubic-bezier(.2,.8,.2,1); }
.h-opt.right > .fill { background: rgba(77,179,80,.4); }
.h-opt .cnt { margin-left: auto; font-weight: 700; font-size: 1.5rem; display: flex; align-items: center; gap: 10px; }
.h-opt .cnt small { font-size: .95rem; font-weight: 600; opacity: .75; }

.bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 18px; align-items: end; height: 220px; margin: 6px 0 4px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bar .col { width: 100%; max-width: 160px; background: var(--info); border-radius: 12px 12px 0 0; min-height: 6px; transition: height .8s cubic-bezier(.2,.8,.2,1); height: 0; }
.bar.right .col { background: var(--gain); }
.bar .n { font-weight: 700; font-size: 1.3rem; }
.expl-h { background: var(--white); color: var(--ink); border-radius: 16px; padding: 14px 20px; font-size: 1.15rem; }
.expl-h b { color: var(--petrol); }

.lb { display: grid; gap: 10px; max-width: 900px; width: 100%; margin: 0 auto; }
.lb-row { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 14px; background: var(--white); color: var(--ink); border-radius: 16px; padding: 12px 18px; font-size: 1.25rem; font-weight: 600; animation: slideIn .5s ease-out both; }
.lb-row .rk { width: 40px; height: 40px; border-radius: 12px; background: var(--petrol); color: var(--white); display: grid; place-items: center; font-weight: 700; }
.lb-row .sc { font-weight: 700; }
.lb-row .dl { font-size: .85rem; font-weight: 600; color: var(--petrol); margin-right: 8px; }
.lb-row .team { font-size: .78rem; font-weight: 500; opacity: .7; display: block; }
@keyframes slideIn { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.teams-lb { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.team-pill { background: var(--info); color: var(--ink); border-radius: 14px; padding: 10px 18px; font-weight: 700; }

.podium { display: flex; justify-content: center; align-items: flex-end; gap: 18px; margin: 10px auto 18px; max-width: 900px; width: 100%; min-height: 300px; }
.pod { flex: 1; max-width: 270px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pod .who { font-weight: 700; font-size: clamp(1rem, 2.2vw, 1.5rem); text-align: center; word-break: break-word; }
.pod .pts { font-weight: 600; opacity: .85; }
.pod .blk { width: 100%; border-radius: 16px 16px 0 0; display: grid; place-items: start center; padding-top: 12px; font-size: 2.4rem; font-weight: 700; color: var(--ink); transition: height 1s cubic-bezier(.2,.8,.2,1); height: 0; }
.pod.p1 .blk { background: var(--orange); }
.pod.p2 .blk { background: var(--info); }
.pod.p3 .blk { background: var(--sand); }
.review { display: grid; gap: 8px; margin-top: 10px; }
.review-row { display: grid; grid-template-columns: 1fr 90px; gap: 12px; align-items: center; background: rgba(255,255,255,.1); border-radius: 12px; padding: 8px 14px; font-size: .95rem; }
.review-row.todo { background: var(--sand); color: var(--ink); }
.review-row .r { text-align: right; font-weight: 700; }
canvas#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

/* ---------- Éditeur ---------- */
.q-list { display: grid; gap: 12px; }
.q-card { background: var(--white); border: 1px solid var(--grey); border-radius: var(--radius); padding: 16px; }
.q-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.q-num { width: 34px; height: 34px; border-radius: 10px; background: var(--petrol); color: var(--white); display: grid; place-items: center; font-weight: 700; flex: none; }
.q-opt { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.q-opt input[type=radio] { width: 22px; height: 22px; accent-color: var(--green); flex: none; }
.q-opt .badge { width: 34px; height: 34px; font-size: .95rem; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 700; }
.q-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--grey); border-radius: var(--radius); background: var(--white); flex-wrap: wrap; }
.list-item .t { font-weight: 600; flex: 1; min-width: 200px; }
.list-item .d { font-size: .85rem; opacity: .7; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab { appearance: none; border: 2px solid var(--petrol); background: var(--white); color: var(--petrol); border-radius: 12px; padding: 8px 18px; font: 600 .95rem var(--font); cursor: pointer; }
.tab.on { background: var(--petrol); color: var(--white); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--white); padding: 12px 20px; border-radius: 12px; font-weight: 600; z-index: 100; animation: pop .25s ease-out; }
.toast.err { background: var(--red); }

@media (max-width: 900px) {
  .lobby { grid-template-columns: 1fr; }
  .h-opts { grid-template-columns: 1fr; }
  .h-wrap { padding: 14px 14px 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.column { display: flex; flex-direction: column; align-items: center; }
.logo-hero { height: 84px; width: auto; display: block; margin: 0 auto 14px; }

.h-actions.mid { justify-content: center; }
.card .btn-big { width: 100%; }
@media (max-width: 600px) { .page-narrow .btn-big { width: 100%; } }

/* ========== V2 : nouveaux formats de question ========== */
.badge.l4 { background: var(--info); color: var(--ink); }
.badge.l5 { background: var(--sand); color: var(--ink); }
.qimg { display: block; max-width: 100%; height: auto; border-radius: 14px; background: var(--soft); }
.qpic { margin: 0 0 14px; display: flex; justify-content: center; }
.qpic .qimg { max-height: 34vh; width: auto; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.tags .tag { background: rgba(255,255,255,.16); color: inherit; }
body.dark .tags .tag, body.petrol .tags .tag { color: var(--white); }

/* Choix multiple */
.opt .chk { margin-left: auto; flex: none; width: 28px; height: 28px; border-radius: 8px; border: 3px solid var(--grey); display: grid; place-items: center; color: transparent; }
.opt.sel { border-color: var(--orange); }
.opt.sel .chk { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.validate { margin-top: 4px; }
.validate .btn { width: 100%; }

/* Remise en ordre */
.ord { display: grid; gap: 10px; margin-bottom: 14px; }
.ord-row { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; background: var(--white); color: var(--ink); border-radius: 16px; padding: 10px 12px; font-weight: 600; transition: transform .2s; }
.ord-row .n { width: 38px; height: 38px; border-radius: 12px; background: var(--petrol); color: var(--white); display: grid; place-items: center; font-weight: 700; }
.ord-row .mv { display: flex; gap: 6px; }
.ord-row .mv button { appearance: none; border: 2px solid var(--petrol); background: var(--white); color: var(--petrol); width: 44px; height: 44px; border-radius: 12px; cursor: pointer; display: grid; place-items: center; }
.ord-row .mv button:disabled { opacity: .25; cursor: default; }
.ord-row .mv button:active:not(:disabled) { background: var(--info); }
.ord.done .ord-row { opacity: .8; }

/* Réponse libre et nuage de mots */
.txt-row { display: flex; gap: 10px; margin-bottom: 12px; }
.txt-row input[type=text] { flex: 1; font-size: 1.15rem; padding: 14px; }
.sent-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.sent-list .tag { background: var(--white); color: var(--ink); font-size: .95rem; padding: 6px 14px; }

/* Curseur numérique */
.num-big { text-align: center; font-size: clamp(3rem, 16vw, 5rem); font-weight: 700; line-height: 1.1; margin: 8px 0 14px; }
.num-ctrl { display: grid; grid-template-columns: 56px 1fr 56px; gap: 12px; align-items: center; margin-bottom: 8px; }
.num-ctrl button { appearance: none; border: 0; background: var(--white); color: var(--ink); width: 56px; height: 56px; border-radius: 16px; cursor: pointer; display: grid; place-items: center; }
.num-ctrl button:active { transform: scale(.94); }
.num-ctrl button:disabled { opacity: .35; }
input[type=range].slider { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; outline: none; margin: 0; }
input[type=range].slider::-webkit-slider-runnable-track { height: 14px; border-radius: 999px; background: rgba(255,255,255,.28); }
input[type=range].slider::-moz-range-track { height: 14px; border-radius: 999px; background: rgba(255,255,255,.28); }
input[type=range].slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; margin-top: -13px; width: 40px; height: 40px; border-radius: 50%; background: var(--orange); border: 4px solid var(--white); cursor: pointer; }
input[type=range].slider::-moz-range-thumb { width: 32px; height: 32px; border-radius: 50%; background: var(--orange); border: 4px solid var(--white); cursor: pointer; }
input[type=range].slider:focus-visible { outline: 3px solid var(--orange); outline-offset: 6px; }
input[type=range].slider:disabled { opacity: .5; }
.scale { display: flex; justify-content: space-between; font-weight: 600; font-size: .9rem; opacity: .8; margin-bottom: 14px; }

/* Zone sur une image */
.zone-box { position: relative; display: block; margin: 0 auto 12px; width: 100%; line-height: 0; touch-action: manipulation; cursor: crosshair; border-radius: 14px; overflow: hidden; }
.zone-box .qimg { width: 100%; border-radius: 0; }
.zone-mark { position: absolute; width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--white); background: rgba(245,136,0,.85); transform: translate(-50%, -50%); box-shadow: 0 0 0 3px var(--ink); pointer-events: none; }
.zone-mark.ok { background: rgba(77,179,80,.9); }
.zone-mark.ko { background: rgba(211,47,47,.9); }
.zone-mark.sm { width: 20px; height: 20px; border-width: 3px; box-shadow: 0 0 0 2px var(--ink); }
.zone-target { position: absolute; border: 5px dashed var(--white); border-radius: 50%; background: rgba(77,179,80,.35); transform: translate(-50%, -50%); pointer-events: none; }

/* Défi photo */
.pick { display: grid; gap: 12px; margin-bottom: 12px; }
.pick .btn { width: 100%; }
.preview { display: block; width: 100%; max-height: 46vh; object-fit: contain; border-radius: 14px; background: rgba(255,255,255,.1); margin-bottom: 12px; }
.vote-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.vote-item { position: relative; appearance: none; border: 4px solid transparent; padding: 0; background: var(--white); border-radius: 16px; overflow: hidden; cursor: pointer; line-height: 0; }
.vote-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.vote-item.sel { border-color: var(--orange); }
.vote-item:disabled { cursor: default; }
.vote-item .lbl { position: absolute; left: 6px; bottom: 6px; line-height: 1.2; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--ink); color: var(--white); }
.vote-item.mine { opacity: .55; }
.vote-item .chk2 { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: var(--ink); display: grid; place-items: center; line-height: 1; }
.thumbs { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; width: 100%; }
.thumbs figure { margin: 0; width: 30%; min-width: 96px; max-width: 160px; background: var(--white); color: var(--ink); border-radius: 14px; overflow: hidden; font-size: .78rem; font-weight: 600; line-height: 1.3; }
.thumbs figure.me { outline: 4px solid var(--orange); }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.thumbs figcaption { padding: 4px 6px; text-align: center; }
.streak { display: inline-flex; align-items: center; gap: 6px; background: var(--ink); color: var(--white); border-radius: 999px; padding: 4px 14px; font-weight: 700; font-size: .95rem; }
.line-answer { font-size: .88rem; opacity: .85; }

/* Écran projeté : nouveaux formats */
.cd { text-align: center; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.cd .num { font-size: clamp(7rem, 24vw, 15rem); font-weight: 700; line-height: 1; animation: pop .5s ease-out; }
.cd .kind { display: inline-flex; gap: 12px; align-items: center; font-size: clamp(1.2rem, 2.6vw, 2rem); font-weight: 600; background: rgba(255,255,255,.14); padding: 8px 26px; border-radius: 999px; }
.h-img { display: flex; justify-content: center; }
.h-img .qimg { max-height: 24vh; width: auto; max-width: 100%; }
.h-order { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: auto; padding-bottom: 8px; }
.h-item { background: var(--white); color: var(--ink); border-radius: 18px; padding: 18px 22px; font-size: clamp(1.1rem, 2.2vw, 1.7rem); font-weight: 600; min-height: 84px; display: flex; align-items: center; gap: 16px; }
.h-item .n { width: 48px; height: 48px; border-radius: 14px; background: var(--petrol); color: var(--white); display: grid; place-items: center; font-weight: 700; font-size: 1.4rem; flex: none; }
.h-item.ok { background: var(--gain); }
.big-hint { text-align: center; margin-top: auto; padding: 22px; background: rgba(255,255,255,.12); border-radius: 22px; font-size: clamp(1.2rem, 2.4vw, 1.9rem); font-weight: 600; display: flex; gap: 18px; align-items: center; justify-content: center; }
.accepted { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.accepted .a { background: var(--gain); color: var(--ink); font-weight: 700; font-size: clamp(1.4rem, 3.4vw, 2.6rem); padding: 12px 30px; border-radius: 20px; }
.wrong { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.wrong .tag { background: var(--sand); font-size: 1rem; padding: 6px 16px; }
.sub { text-align: center; font-weight: 600; font-size: 1.15rem; opacity: .85; }
.hist { display: flex; align-items: flex-end; gap: 4px; height: 230px; position: relative; margin: 8px 0 0; }
.hist .hb { flex: 1; background: var(--info); border-radius: 8px 8px 0 0; min-height: 4px; height: 0; transition: height .9s cubic-bezier(.2,.8,.2,1); position: relative; }
.hist .hb.hit { background: var(--gain); }
.hist .hb span { position: absolute; top: -26px; left: 0; right: 0; text-align: center; font-weight: 700; font-size: 1.05rem; }
.hist-wrap { position: relative; padding-top: 24px; }
.hist-mark { position: absolute; top: 0; bottom: 0; width: 6px; margin-left: -3px; background: var(--orange); border-radius: 3px; }
.hist-mark::after { content: attr(data-v); position: absolute; top: -30px; left: 50%; transform: translateX(-50%); background: var(--orange); color: var(--ink); font-weight: 700; padding: 2px 12px; border-radius: 999px; white-space: nowrap; line-height: 1.4; }
.hist-band { position: absolute; top: 24px; bottom: 0; background: rgba(184,244,184,.28); border-radius: 6px; }
.range-lbl { display: flex; justify-content: space-between; font-weight: 600; font-size: 1.1rem; margin-top: 8px; opacity: .85; }
.zone-host { position: relative; display: block; margin: 0 auto; line-height: 0; width: fit-content; max-width: 100%; }
.zone-host .qimg { max-height: 52vh; width: auto; max-width: 100%; }
.zone-live { position: relative; display: block; margin: 0 auto; width: fit-content; line-height: 0; }
.zone-live .qimg { max-height: 36vh; width: auto; max-width: 100%; }
.cloud { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 22px; min-height: 160px; padding: 10px; }
.cloud .w { font-weight: 700; line-height: 1.15; animation: pop .35s ease-out; }
.cloud .c0 { color: var(--white); } .cloud .c1 { color: var(--info); } .cloud .c2 { color: var(--gain); } .cloud .c3 { color: var(--sand); } .cloud .c4 { color: var(--orange); }
.cloud-empty { text-align: center; opacity: .7; font-size: 1.3rem; padding: 40px 0; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-top: 6px; }
.ph-tile { position: relative; border-radius: 16px; overflow: hidden; background: rgba(255,255,255,.12); line-height: 0; aspect-ratio: 1; animation: pop .3s ease-out; }
.ph-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-tile.blur img { filter: blur(18px) saturate(1.2); transform: scale(1.15); }
.ph-tile .x { position: absolute; top: 8px; right: 8px; appearance: none; border: 0; border-radius: 50%; width: 34px; height: 34px; background: var(--red); color: var(--white); cursor: pointer; display: grid; place-items: center; }
.ph-tile .cap { position: absolute; left: 0; right: 0; bottom: 0; line-height: 1.3; padding: 8px 12px; background: rgba(11,58,74,.85); color: var(--white); font-weight: 600; font-size: .95rem; display: flex; justify-content: space-between; gap: 8px; }
.ph-tile.win { outline: 6px solid var(--orange); }
.ph-big { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; align-items: end; }
.ph-big .ph-tile { aspect-ratio: auto; }
.ph-big .ph-tile img { aspect-ratio: 1; height: auto; }
.ph-big .ph-tile.first img { aspect-ratio: 1; }
.rank-badge { background: var(--orange); color: var(--ink); width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; flex: none; }

/* Options de partie (préparation) */
.opt-list { display: grid; gap: 10px; margin-bottom: 8px; }
.opt-row { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; }
.opt-row input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--petrol); flex: none; margin-top: 2px; }
.opt-row b { display: block; font-weight: 600; }
.opt-row .hint { margin-top: 2px; }

/* Éditeur : nouveaux champs */
.type-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.type-pick button { appearance: none; border: 2px solid var(--petrol); background: var(--white); color: var(--petrol); border-radius: 999px; padding: 5px 14px; font: 600 .85rem var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.type-pick button.on { background: var(--petrol); color: var(--white); }
.q-opt input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--green); flex: none; }
.q-opt .n { width: 34px; height: 34px; border-radius: 10px; background: var(--petrol); color: var(--white); display: grid; place-items: center; font-weight: 700; flex: none; }
.img-edit { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin: 10px 0; }
.img-edit .qimg { max-width: 220px; max-height: 150px; width: auto; }
.zone-edit { position: relative; display: block; width: 100%; max-width: 640px; line-height: 0; cursor: crosshair; border-radius: 14px; overflow: hidden; margin: 8px 0; border: 2px solid var(--petrol); }
.zone-edit .qimg { width: 100%; border-radius: 0; }
.sub-box { background: var(--soft); border-radius: 14px; padding: 12px 14px; margin-top: 10px; }
.sub-box .hint { margin-top: 2px; }
.cd-num { font-size: clamp(7rem, 40vw, 13rem); font-weight: 700; line-height: 1; animation: pop .5s ease-out; }

/* Pas de césure automatique, retours à la ligne propres sur téléphone */
html { hyphens: none; -webkit-hyphens: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
h1, h2, h3, .qtext, .h-qtext, .big-name, .res-title { text-wrap: balance; }
p, .expl, .expl-h, .hint { text-wrap: pretty; }

/* Cibles tactiles confortables (44 px) sur téléphone et tablette */
@media (pointer: coarse) {
  .btn-small { min-height: 44px; }
  .type-pick button { min-height: 40px; }
  .tabs .tab, .tab { min-height: 44px; }
  input[type=checkbox], input[type=radio] { min-width: 22px; min-height: 22px; }
}

/* Petits écrans : boutons sur une ligne, texte aligné à gauche (le justifié crée des trous dans une colonne étroite) */
@media (max-width: 360px) {
  .btn-big { font-size: 1rem; padding-left: 12px; padding-right: 12px; gap: 8px; }
}
@media (max-width: 480px) {
  .just { text-align: left; }
}

/* Écrans animateur et éditeur sur téléphone */
@media (max-width: 600px) {
  .q-head .hint { flex: 1 0 100%; order: 3; margin-top: 0; }
  .q-head .q-num { order: 0; }
  .q-head .grow { min-width: 0; }
  .page > .row[data-top] { flex-wrap: wrap; }
  .page > .row[data-top] .brand { flex: 1 0 100%; }
}
.field > .opt-row { cursor: pointer; }
.page > .row[data-top] { margin-bottom: 14px; }
