/* ===== Team building — style « fun et coloré » ===== */
:root {
  --bg1: #2a0f5c;
  --bg2: #6a11cb;
  --bg3: #ff3c8e;
  --ink: #1b0b3a;
  --white: #ffffff;
  --card: rgba(255, 255, 255, 0.12);
  --card-strong: rgba(255, 255, 255, 0.2);
  --ok: #19d48b;
  --ko: #ff4d5e;
  --gold: #ffc233;

  /* couleurs des 4 réponses */
  --c0: #ff4f9a; /* ★ rose */
  --c1: #00c2d1; /* ☾ turquoise */
  --c2: #ffb703; /* ⚡ jaune */
  --c3: #8b5cf6; /* ♥ violet */

  --radius: 22px;
  font-family: 'Fredoka', 'Baloo 2', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  color: var(--white);
}

* { box-sizing: border-box; }
html { background: #3a1280; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 60, 142, 0.55), transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(0, 194, 209, 0.45), transparent 45%),
    linear-gradient(135deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; }
.hidden { display: none !important; }

/* ---------- éléments communs ---------- */
.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(8px);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 24px;
  border-radius: 18px;
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.08s, box-shadow 0.08s, opacity 0.2s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--gold); }
.btn.pink { background: var(--c0); color: #fff; }
.btn.ghost { background: var(--card-strong); color: #fff; box-shadow: none; }
.btn.danger { background: var(--ko); color: #fff; }
.btn.big { font-size: 1.4rem; padding: 20px 28px; width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field label { font-weight: 600; opacity: 0.9; }
.field input[type='text'], .field input[type='email'], .field input[type='password'] {
  padding: 16px 18px;
  border-radius: 16px;
  border: 3px solid transparent;
  background: #fff;
  color: var(--ink);
  font-size: 1.2rem;
  outline: none;
}
.field input:focus { border-color: var(--gold); }
.check { display: flex; gap: 12px; align-items: flex-start; text-align: left; font-size: 0.95rem; line-height: 1.35; }
.check input { width: 24px; height: 24px; flex: none; accent-color: var(--gold); margin-top: 1px; }
.error { color: #fff; background: var(--ko); padding: 10px 14px; border-radius: 12px; font-weight: 600; }
.error:empty { display: none; }

.shape { font-size: 1.4em; line-height: 1; }
.c0 { background: var(--c0); }
.c1 { background: var(--c1); color: var(--ink); }
.c2 { background: var(--c2); color: var(--ink); }
.c3 { background: var(--c3); }

.pop { animation: pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.rise { animation: rise 0.5s ease-out both; }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.shake { animation: shake 0.4s; }
@keyframes shake { 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
.float { animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px); } }

[data-timer].urgent { color: var(--ko); animation: pulse 0.5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.12); } }

.conn-banner {
  position: fixed; left: 50%; top: 12px; transform: translate(-50%, -150%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-weight: 600; z-index: 100; transition: transform 0.3s;
}
.conn-banner.show { transform: translate(-50%, 0); }

/* ======================= JOUEUR ======================= */
.player { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding: 16px; gap: 16px; }
.player header { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.player header .pill { background: var(--card-strong); padding: 8px 14px; border-radius: 999px; }
.player main { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; text-align: center; }
.player h1 { font-size: 2rem; margin: 0; }
.player p { font-size: 1.15rem; margin: 0; opacity: 0.95; }
.player .emoji { font-size: 4.5rem; }
.logo { font-weight: 800; font-size: 1.6rem; letter-spacing: 0.5px; }
.logo span { color: var(--gold); }

.timerbar { height: 10px; background: rgba(255, 255, 255, 0.2); border-radius: 99px; overflow: hidden; }
.timerbar > div { height: 100%; background: var(--gold); transform-origin: left; }

.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; min-height: 50dvh; }
.answers button {
  border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 14px; font-size: 1.25rem; font-weight: 700; color: #fff;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.08s;
}
.answers button.c1, .answers button.c2 { color: var(--ink); }
.answers button .shape { font-size: 2.6rem; }
.answers button:active { transform: translateY(5px) scale(0.98); }

.code-input {
  font-size: 2.2rem !important; text-align: center; letter-spacing: 0.3em; text-transform: uppercase; font-weight: 700;
}
.result { border-radius: var(--radius); padding: 28px 20px; display: flex; flex-direction: column; gap: 10px; }
.result.ok { background: var(--ok); color: var(--ink); }
.result.ko { background: var(--ko); }
.result.none { background: var(--card-strong); }
.result .points { font-size: 2.6rem; font-weight: 800; }
.score-line { font-size: 1.2rem; }
.score-line b { color: var(--gold); }

/* ======================= GRAND ÉCRAN ======================= */
.screen { height: 100dvh; display: flex; flex-direction: column; padding: 3vh 3vw; gap: 2.5vh; overflow: hidden; font-size: 2.2vh; }
.screen > main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.fs-btn, .gear-btn { position: fixed; right: 14px; z-index: 50; opacity: 0.35; padding: 10px 14px; font-size: 1.3rem; text-decoration: none; box-shadow: none; }
.fs-btn { bottom: 14px; }
.gear-btn { bottom: 72px; }
.fs-btn:hover, .gear-btn:hover { opacity: 1; }

.lobby { flex: 1; display: grid; grid-template-columns: auto 1fr; gap: 5vw; align-items: center; }
.lobby .qr-box { background: #fff; border-radius: 3vh; padding: 2.5vh; box-shadow: 0 2vh 6vh rgba(0, 0, 0, 0.35); text-align: center; color: var(--ink); }
.lobby .qr-box img { width: 52vh; height: 52vh; display: block; }
.lobby .qr-box .url { font-size: 3.2vh; font-weight: 700; margin-top: 1.5vh; }
.lobby h1 { font-size: 8vh; margin: 0 0 2vh; line-height: 1; }
.lobby .count { font-size: 5vh; font-weight: 700; margin-bottom: 3vh; }
.lobby .count b { color: var(--gold); font-size: 9vh; }
.names { display: flex; flex-wrap: wrap; gap: 1.2vh; max-height: 45vh; overflow: hidden; align-content: flex-start; }
.names span { background: var(--card-strong); padding: 1vh 2vh; border-radius: 999px; font-size: 3vh; font-weight: 600; }

.q-top { display: flex; justify-content: space-between; align-items: center; }
.q-top .q-num { background: var(--card-strong); padding: 1vh 2.4vh; border-radius: 999px; font-size: 3vh; font-weight: 700; }
.ring {
  --p: 1;
  width: 14vh; height: 14vh; border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--p) * 360deg), rgba(255, 255, 255, 0.15) 0);
  display: grid; place-items: center;
}
.ring > div { width: 11vh; height: 11vh; border-radius: 50%; background: var(--bg1); display: grid; place-items: center; font-size: 6vh; font-weight: 800; }
.q-text { text-align: center; font-size: 6vh; font-weight: 700; line-height: 1.15; margin: 2vh 4vw; text-wrap: balance; }
.q-image { flex: 1; min-height: 0; display: flex; justify-content: center; margin-bottom: 2vh; }
.q-image img { max-height: 100%; max-width: 100%; border-radius: 2vh; object-fit: contain; }
.q-mid { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 4vw; font-size: 4vh; }
.q-mid .big { font-size: 14vh; }
.answered { text-align: center; font-size: 3.5vh; font-weight: 700; }
.answered b { color: var(--gold); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 2vh; }
.tile {
  position: relative; overflow: hidden;
  border-radius: 2.5vh; padding: 3vh 3vh; display: flex; align-items: center; gap: 2.5vh;
  font-size: 4.4vh; font-weight: 700; min-height: 13vh;
  box-shadow: 0 1vh 0 rgba(0, 0, 0, 0.25);
  transition: opacity 0.4s, transform 0.4s;
}
.tile .shape { font-size: 6vh; }
.tile .label { flex: 1; position: relative; }
.tile .bar { position: absolute; inset: 0 auto 0 0; background: rgba(255, 255, 255, 0.25); transform-origin: left; transition: width 0.8s ease-out; }
.tile .n { position: relative; font-size: 5vh; font-weight: 800; }
.tile.dim { opacity: 0.3; transform: scale(0.97); }
.tile.good { outline: 0.8vh solid #fff; }
.tile.good::after { content: '✔'; position: relative; font-size: 6vh; }

.banner { align-self: center; background: var(--ko); padding: 1.5vh 4vh; border-radius: 999px; font-size: 4vh; font-weight: 800; margin-bottom: 2vh; }
.code-reveal { font-size: 14vh; font-weight: 800; letter-spacing: 0.15em; background: #fff; color: var(--ink); padding: 2vh 6vh; border-radius: 3vh; max-width: 80vw; text-align: center; }
.code-reveal.long { font-size: 8vh; letter-spacing: normal; line-height: 1.1; }
.sound-btn { position: fixed; left: 50%; bottom: 3vh; transform: translateX(-50%); z-index: 60; font-size: 1.3rem; }
.sound-btn:active { transform: translateX(-50%) translateY(4px); }

.overlay-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4vh; text-align: center; }
.overlay-center .qr-big { background: #fff; padding: 3vh; border-radius: 3vh; }
.overlay-center .qr-big img { width: 62vh; height: 62vh; display: block; }
.overlay-center .url { font-size: 5vh; font-weight: 700; }
.message { font-size: 11vh; font-weight: 800; line-height: 1.1; max-width: 85vw; text-wrap: balance; }

.board { width: min(90vw, 140vh); display: flex; flex-direction: column; gap: 1.4vh; }
.board h1 { font-size: 7vh; margin: 0 0 2vh; text-align: center; }
.board .row { text-align: left; display: flex; align-items: center; gap: 3vh; background: var(--card-strong); border-radius: 2vh; padding: 1.4vh 3vh; font-size: 4vh; font-weight: 700; }
.board .row .rk { width: 7vh; text-align: center; font-weight: 800; }
.board .row .nm { flex: 1; }
.board .row .gain { font-size: 2.8vh; color: var(--ok); }
.board .row.top1 { background: var(--gold); color: var(--ink); }
.board .row.top2 { background: #e0e7ff; color: var(--ink); }
.board .row.top3 { background: #ffb38a; color: var(--ink); }

/* ======================= RÉGIE ======================= */
.host { max-width: 1100px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.host header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.host header .title { font-size: 1.4rem; font-weight: 800; flex: 1; }
.status { padding: 6px 14px; border-radius: 999px; font-weight: 700; background: var(--card-strong); }
.status.ph-question { background: var(--ok); color: var(--ink); }
.status.ph-closed { background: var(--gold); color: var(--ink); }
.status.ph-reveal { background: var(--c1); color: var(--ink); }
.host .grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 800px) { .host .grid { grid-template-columns: 1fr; } }
.host h2 { margin: 0 0 12px; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; opacity: 0.8; }
.host .qprev { font-size: 1.3rem; font-weight: 700; margin-bottom: 12px; }
.host .qprev small { display: block; font-size: 0.9rem; opacity: 0.75; font-weight: 600; margin-bottom: 4px; }
.host .choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.host .choices div { padding: 10px 12px; border-radius: 12px; font-weight: 600; opacity: 0.45; }
.host .choices div.good { opacity: 1; outline: 3px solid #fff; }
.host .stats { display: flex; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.host .stat { background: var(--card-strong); border-radius: 14px; padding: 10px 14px; font-weight: 700; }
.host .stat b { color: var(--gold); font-size: 1.4rem; }
.host .next { opacity: 0.75; margin-top: 12px; font-size: 0.95rem; }
.host .row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.host .row-btns .btn { flex: 1; padding: 12px 14px; font-size: 1rem; }
.host .row-btns .btn.active { background: var(--gold); color: var(--ink); }
.host .msg { display: flex; gap: 8px; margin-top: 10px; }
.host .msg input { flex: 1; padding: 12px 14px; border-radius: 14px; border: 0; color: var(--ink); background: #fff; font-size: 1rem; }
.plist { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; }
.plist div { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); }
.plist .rk { width: 28px; opacity: 0.7; font-weight: 700; }
.plist .nm { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; }
.plist .dot.off { background: #888; }
.plist .ans { width: 20px; text-align: center; }
.login { max-width: 380px; margin: 15vh auto; display: flex; flex-direction: column; gap: 16px; text-align: center; }

/* ---------- régie : onglets ---------- */
.tabs { display: flex; gap: 6px; background: rgba(0, 0, 0, 0.2); padding: 5px; border-radius: 999px; }
.tab { background: transparent; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 1rem; }
.tab.active { background: #fff; color: var(--ink); }
.quiz-pick { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.quiz-pick select, .host select {
  flex: 1; padding: 10px 12px; border-radius: 12px; border: 0; font: inherit; font-weight: 600; color: var(--ink); background: #fff;
}

/* ---------- éditeur ---------- */
.editor { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
@media (max-width: 800px) { .editor { grid-template-columns: 1fr; } }
.qlist { display: flex; flex-direction: column; gap: 6px; }
.qitem { text-align: left; background: rgba(255, 255, 255, 0.08); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.qitem.active { background: #fff; color: var(--ink); }
.qitem .t { font-weight: 700; }
.qitem .m { font-size: 0.85rem; opacity: 0.75; display: flex; gap: 8px; align-items: center; }
.badge { background: var(--ok); color: var(--ink); font-weight: 700; padding: 1px 8px; border-radius: 999px; font-size: 0.75rem; opacity: 1; }

.ed-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; position: sticky; top: 8px; z-index: 5; background: rgba(42, 15, 92, 0.9); }
.title-input { font-size: 1.5rem; font-weight: 700; padding: 10px 14px; border-radius: 14px; border: 0; background: #fff; color: var(--ink); }
.toolbar .btn { flex: none; }

.qcards { display: flex; flex-direction: column; gap: 10px; }
.qcard { background: var(--card); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 18px; overflow: hidden; }
.qcard.open { background: var(--card-strong); }
.qhead { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; }
.qhead .qn { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; font-weight: 800; flex: none; }
.qhead .qtext { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qactions { display: flex; gap: 4px; }
.qactions button { background: rgba(255, 255, 255, 0.15); width: 34px; height: 34px; border-radius: 10px; font-size: 1rem; }
.qactions button:disabled { opacity: 0.3; }
.chev { opacity: 0.7; }
.qbody { padding: 4px 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.qbody textarea, .qbody input[type='text'], .qbody input[type='number'] {
  padding: 12px 14px; border-radius: 12px; border: 3px solid transparent; background: #fff; color: var(--ink); font: inherit; font-size: 1.05rem; outline: none;
}
.qbody textarea { resize: vertical; }
.qbody textarea:focus, .qbody input:focus { border-color: var(--gold); }
.qbody input[type='number'] { width: 100px; }
.seg { display: flex; gap: 6px; background: rgba(0, 0, 0, 0.2); padding: 5px; border-radius: 14px; }
.seg button { flex: 1; background: transparent; padding: 10px; border-radius: 10px; font-weight: 700; }
.seg button.on { background: #fff; color: var(--ink); }
.choice-rows { display: flex; flex-direction: column; gap: 8px; }
.choice-row { display: flex; align-items: center; gap: 10px; }
.choice-row input[type='text'] { flex: 1; min-width: 0; }
.choice-row .sw { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; flex: none; }
.good-pick { display: flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.good-pick input { width: 22px; height: 22px; accent-color: var(--ok); }
.inline-field { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.media-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) { .media-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .media-row { grid-template-columns: 1fr; } }
.media { background: rgba(0, 0, 0, 0.18); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.media-label { font-weight: 700; }
.media-add { width: 100%; border: 2px dashed rgba(255, 255, 255, 0.4) !important; padding: 18px; }
.media-preview { display: flex; flex-direction: column; gap: 8px; }
.media-preview img { max-width: 100%; max-height: 160px; border-radius: 10px; object-fit: contain; align-self: flex-start; }
.media-preview audio { width: 100%; }
.media-preview .btn { padding: 8px 12px; font-size: 0.9rem; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 150%); z-index: 200;
  padding: 12px 20px; border-radius: 14px; font-weight: 700; background: var(--ok); color: var(--ink);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35); transition: transform 0.3s; max-width: 90vw; text-align: center;
}
.toast.show { transform: translate(-50%, 0); }
.toast.err { background: var(--ko); color: #fff; }
.toast.info { background: #fff; }

/* ---------- réponses en image ---------- */
.tiles.img-tiles { flex: 1; min-height: 0; grid-template-columns: repeat(var(--n, 4), 1fr); grid-auto-rows: 1fr; }
.img-tiles .tile { flex-direction: column; justify-content: center; padding: 1.5vh; gap: 1.2vh; min-height: 0; }
.img-tiles .tile .shape { position: absolute; top: 1.2vh; left: 1.5vh; z-index: 2; font-size: 4.5vh; text-shadow: 0 0.3vh 0.6vh rgba(0, 0, 0, 0.35); }
.img-tiles .tile .choice-img { flex: 1; min-height: 0; width: 100%; object-fit: contain; border-radius: 1.5vh; background: rgba(255, 255, 255, 0.92); }
.img-tiles .tile .label { flex: none; text-align: center; font-size: 3.6vh; }
.img-tiles .tile .bar { inset: auto auto 0 0; height: 1.2vh; background: #fff; }
.img-tiles .tile .n { position: absolute; top: 1vh; right: 1.5vh; z-index: 2; background: rgba(0, 0, 0, 0.35); color: #fff; padding: 0.2vh 1.6vh; border-radius: 999px; }
.img-tiles .tile.good::after { position: absolute; top: 0.6vh; left: 7.5vh; z-index: 2; }

.answers .choice-img { width: 100%; flex: 1; min-height: 0; max-height: 22dvh; object-fit: contain; border-radius: 14px; background: rgba(255, 255, 255, 0.92); }
.answers.has-img button { padding: 10px; gap: 6px; }
.answers.has-img button .shape { font-size: 1.8rem; }

.choice-row .img-pick { width: 52px; height: 44px; flex: none; border-radius: 10px; background: rgba(255, 255, 255, 0.15); border: 2px dashed rgba(255, 255, 255, 0.45); font-size: 1.2rem; overflow: hidden; padding: 0; position: relative; }
.choice-row .img-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.choice-row .img-pick.filled { border-style: solid; border-color: #fff; }
.choice-row .img-del { width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, 0.3); flex: none; }
.host .choices img { height: 34px; width: 46px; object-fit: cover; border-radius: 6px; vertical-align: middle; margin-right: 6px; background: #fff; }
.audio-status { margin-top: 8px; font-weight: 700; padding: 8px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.2); }
.audio-status.blocked { background: var(--ko); }
.audio-status.playing { background: var(--ok); color: var(--ink); }

.q-image.reveal-img img { background: #fff; padding: 2vh; border-radius: 3vh; box-shadow: 0 2vh 6vh rgba(0, 0, 0, 0.35); }

/* ---------- tout tient dans la largeur (pas de débordement à droite) ---------- */
.host { width: 100%; overflow-x: hidden; }
.host .grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.editor { grid-template-columns: 240px minmax(0, 1fr); }
.editor > *, .host .grid > * { min-width: 0; }
.qhead .qtext { min-width: 0; }
.qhead .qactions { flex: none; }
.toolbar .btn { flex: 1 1 auto; min-width: 0; padding: 12px 14px; font-size: 0.95rem; }
.host .choices div { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.host .qprev { overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .host .grid { grid-template-columns: minmax(0, 1fr); }
}

/* ✕ pour supprimer un quiz dans « Mes quiz » */
.qitem-wrap { position: relative; }
.qitem-wrap .qitem { width: 100%; padding-right: 44px; }
.qdel {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, 0.25); color: #fff; font-weight: 700;
}
.qdel:hover { background: var(--ko); }
.qitem.active + .qdel { background: rgba(27, 11, 58, 0.15); color: var(--ink); }
.qitem.active + .qdel:hover { background: var(--ko); color: #fff; }

/* ======================= ÉQUIPES ======================= */
:root { --t0: #ff4d6d; --t1: #3a86ff; }
.t0 { --tc: var(--t0); }
.t1 { --tc: var(--t1); }
.pill.team { background: var(--tc); }
.team-badge { align-self: center; background: var(--tc); padding: 12px 20px; border-radius: 16px; font-size: 1.2rem; }
.duel-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duel-mini > div { background: var(--tc); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; align-items: center; opacity: 0.75; }
.duel-mini > div.mine { opacity: 1; outline: 3px solid #fff; }
.duel-mini b { font-size: 1.8rem; }
.duel-mini small { opacity: 0.85; }

/* notes (joueur) */
.head-right { display: flex; gap: 8px; align-items: center; }
.notes-btn { padding: 8px 14px; font-size: 0.95rem; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); }
.notes-panel {
  position: fixed; inset: 0; z-index: 80; padding: 16px; display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
}
.notes-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.notes-head h2 { margin: 0; }
.notes-hint { margin: 0; opacity: 0.85; }
.notes-panel textarea {
  flex: 1; width: 100%; border-radius: 18px; border: 0; padding: 16px; font: inherit; font-size: 1.2rem; line-height: 1.5;
  color: var(--ink); background: #fffbea; resize: none; outline: none;
}

/* grand écran : équipes */
.team-counts { display: flex; gap: 2vh; margin-bottom: 3vh; }
.team-counts > div { background: var(--tc); padding: 1.2vh 3vh; border-radius: 999px; font-size: 3.4vh; font-weight: 700; }
.names span.t0, .names span.t1 { background: var(--tc); }
.duel { display: grid; grid-template-columns: 1fr 1fr; gap: 3vw; width: min(90vw, 150vh); }
.duel > div { background: var(--tc); border-radius: 3vh; padding: 3vh; text-align: center; box-shadow: 0 1.2vh 0 rgba(0, 0, 0, 0.25); }
.duel .tn { font-size: 5vh; font-weight: 800; }
.duel .ts { font-size: 11vh; font-weight: 800; line-height: 1.1; }
.duel .tl { font-size: 2.8vh; opacity: 0.9; }
.duel > div.win { outline: 1vh solid var(--gold); transform: scale(1.04); }
.duel > div.lose { opacity: 0.6; }
.board .row .tdot { width: 2.2vh; height: 2.2vh; border-radius: 50%; background: var(--tc); flex: none; }
.winner-title { font-size: 9vh; font-weight: 800; text-align: center; line-height: 1.1; }
.winner-sub { font-size: 4.5vh; font-weight: 700; color: var(--gold); }

/* régie : équipes */
.team-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.team-edit .t0, .team-edit .t1 { min-width: 0; overflow-wrap: anywhere; background: var(--tc); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.team-edit input { padding: 8px 10px; border-radius: 10px; border: 0; font: inherit; font-weight: 700; color: var(--ink); min-width: 0; }
.team-edit .ts { font-weight: 700; }
.plist .tdot { width: 14px; height: 14px; border-radius: 50%; background: var(--tc); flex: none; }
.plist .swap { background: rgba(255, 255, 255, 0.15); border-radius: 8px; padding: 2px 8px; font-size: 0.85rem; }

/* 🤖 mode test */
.bots-hint { margin: 0 0 8px; opacity: 0.8; font-size: 0.9rem; }
.bots-row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.bots-row input { width: 70px; padding: 10px; border-radius: 12px; border: 0; font: inherit; font-weight: 700; color: var(--ink); text-align: center; }
.bots-row .btn { padding: 10px 14px; font-size: 0.95rem; flex: 1; }

/* 🔐 énigmes finales (téléphone) */
.finale { display: flex; flex-direction: column; gap: 12px; text-align: center; margin-top: 6px; }
.finale h2 { margin: 0; font-size: 1.5rem; }
.finale p { margin: 0; }
.riddle-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.riddle-btn { background: var(--card-strong); color: #fff; padding: 14px 8px; font-size: 1.05rem; }
.riddle-btn.active { background: var(--gold); color: var(--ink); }
.riddle-text { background: #fffbea; color: var(--ink); border-radius: 16px; padding: 16px; text-align: left; font-size: 1.15rem; line-height: 1.45; }
.riddle-text p { margin: 6px 0 0; }
.finale-hint { opacity: 0.8; font-size: 0.9rem; }
.finale-screen { font-size: 4.2vh; font-weight: 700; background: var(--card-strong); padding: 1.5vh 4vh; border-radius: 999px; }

.finale-ed { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.finale-ed h2 { margin: 0; }
.finale-ed textarea { padding: 12px 14px; border-radius: 12px; border: 3px solid transparent; background: #fff; color: var(--ink); font: inherit; font-size: 1.05rem; resize: vertical; outline: none; }
.finale-ed textarea:focus { border-color: var(--gold); }

.finale-ed .img-del { width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, 0.3); color: #fff; font-weight: 700; flex: none; }
.finale-ed .img-del:hover { background: var(--ko); }

/* 👥 base des joueurs (régie) */
.pl-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.pl-head h2 { flex: 1 1 100%; display: flex; gap: 10px; align-items: center; }
.pl-head input { flex: 1 1 220px; padding: 12px 14px; border-radius: 12px; border: 0; font: inherit; color: var(--ink); min-width: 0; }
.pl-head .btn { padding: 12px 16px; font-size: 0.95rem; }
.pl-table-wrap { overflow-x: auto; }
.pl-table { width: 100%; border-collapse: collapse; }
.pl-table th { text-align: left; font-size: 0.85rem; text-transform: uppercase; opacity: 0.75; padding: 8px; }
.pl-table td { padding: 10px 8px; border-top: 1px solid rgba(255, 255, 255, 0.12); vertical-align: middle; }
.pl-table td a { color: #fff; }
.pl-table .qdel { position: static; transform: none; }

/* texte de la question sur le téléphone */
.q-phone { background: var(--card-strong); border-radius: 18px; padding: 14px 16px; font-size: 1.25rem; font-weight: 700; line-height: 1.3; text-align: center; }
.q-phone small { display: block; font-size: 0.85rem; font-weight: 600; opacity: 0.8; margin-bottom: 4px; }
.answers { min-height: 40dvh; }
