@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
/* =============================================================================
 * MyToolsSuite — Sondage Live : styles des overlays (OBS, présentation, aperçu)
 * Compatible navigateur intégré d'OBS (pas de color-mix ni :has)
 * ========================================================================== */
.spx-stage { position: relative; width: 1920px; height: 1080px; overflow: hidden; transform-origin: top left; color: #fff; -webkit-font-smoothing: antialiased; }
.spx-stage * { box-sizing: border-box; }
.spx-anchor { position: absolute; width: max-content; max-width: 1840px; }
.spx-pos-top-left { top: 48px; left: 56px; }
.spx-pos-top-center { top: 48px; left: 50%; transform: translateX(-50%); }
.spx-pos-top-right { top: 48px; right: 56px; }
.spx-pos-center { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.spx-pos-bottom-left { bottom: 56px; left: 56px; }
.spx-pos-bottom-center { bottom: 56px; left: 50%; transform: translateX(-50%); }
.spx-pos-bottom-right { bottom: 56px; right: 56px; }

/* --- Carte ------------------------------------------------------------------ */
.spx-card { width: 860px; font-family: var(--spx-font, 'Inter', sans-serif); transform: scale(var(--spx-scale, 1)); background: rgba(15,23,42,.94); border: 1px solid rgba(255,255,255,.08); border-radius: 28px; box-shadow: 0 26px 70px rgba(2,6,23,.55); overflow: hidden; position: relative; }
.spx-pos-top-left .spx-card, .spx-pos-bottom-left .spx-card { transform-origin: left center; }
.spx-pos-top-right .spx-card, .spx-pos-bottom-right .spx-card { transform-origin: right center; }
.spx-pos-top-center .spx-card { transform-origin: top center; }
.spx-pos-bottom-center .spx-card { transform-origin: bottom center; }
.spx-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--spx-accent); }
.spx-head { padding: 30px 36px 10px; }
.spx-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: #94a3b8; }
.spx-qnum { color: var(--spx-accent); }
.spx-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.08); color: #e2e8f0; }
.spx-status.is-open { background: rgba(16,185,129,.18); color: #6ee7b7; }
.spx-status.is-open i { width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 10px #10b981; display: inline-block; animation: spx-pulse 1.2s infinite; }
.spx-status.is-closed { background: rgba(244,63,94,.16); color: #fda4af; }
.spx-timer { padding: 4px 12px; border-radius: 999px; background: var(--spx-accent); color: #fff; font-variant-numeric: tabular-nums; }
.spx-timer.is-low { background: #e11d48; animation: spx-pulse .8s infinite; }
.spx-total { margin-left: auto; color: #cbd5e1; }
.spx-question { font-size: 40px; font-weight: 800; line-height: 1.15; color: #fff; letter-spacing: -.01em; }
.spx-body { padding: 18px 36px 30px; }
.spx-brand { text-align: center; font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: #94a3b8; background: rgba(2,6,23,.85); padding: 7px 12px; }
.spx-chatnote { padding: 0 36px 16px; font-size: 14px; font-weight: 700; color: #c4b5fd; }
.spx-empty { color: #94a3b8; font-size: 22px; padding: 28px 0; text-align: center; }
.spx-hidden-results { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.05); color: #cbd5e1; font-size: 18px; font-weight: 700; }
.spx-lock { width: 16px; height: 16px; border: 3px solid #cbd5e1; border-radius: 4px; display: inline-block; }

/* --- Choix ------------------------------------------------------------------ */
.spx-opts { display: flex; flex-direction: column; gap: 16px; }
.spx-opt-label { display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.spx-key { width: 34px; height: 34px; border-radius: 10px; background: var(--c); color: var(--ct); display: inline-flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 900; flex-shrink: 0; }
.spx-opt-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spx-opt-val { display: flex; align-items: baseline; gap: 8px; }
.spx-opt-val b { font-size: 28px; font-weight: 900; font-variant-numeric: tabular-nums; }
.spx-opt-val small { font-size: 16px; color: #94a3b8; font-weight: 700; }
.spx-bar { height: 22px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.spx-fill { height: 100%; border-radius: 999px; background: var(--c); transition: width .8s cubic-bezier(.2,.8,.2,1); min-width: 0; }
.spx-opt.is-leader .spx-fill { box-shadow: 0 0 22px var(--c); }
.spx-opt.is-good .spx-key { background: #22c55e; color: #052e16; }
.spx-opt.is-good .spx-fill { background: #22c55e; }
.spx-opt.is-bad { opacity: .45; }
.spx-check { color: #4ade80; font-size: 26px; }

/* --- Versus ----------------------------------------------------------------- */
.spx-vs { display: flex; position: relative; height: 300px; border-radius: 22px; overflow: hidden; }
.spx-vs-side { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 18px; position: relative; overflow: hidden; background: var(--c); transition: flex-grow .8s cubic-bezier(.2,.8,.2,1); min-width: 120px; }
.spx-vs-side.a { background: linear-gradient(90deg, var(--c), rgba(15,23,42,.4)); }
.spx-vs-side.b { background: linear-gradient(270deg, var(--c), rgba(15,23,42,.4)); }
.spx-vs-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; }
.spx-vs-name, .spx-vs-pct, .spx-vs-n { position: relative; z-index: 1; text-shadow: 0 3px 12px rgba(0,0,0,.6); text-align: center; }
.spx-vs-name { font-size: 34px; font-weight: 900; text-transform: uppercase; }
.spx-vs-pct { font-size: 64px; font-weight: 900; font-variant-numeric: tabular-nums; }
.spx-vs-n { font-size: 16px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.spx-vs-side.is-win .spx-vs-pct { color: #fde68a; }
.spx-vs-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; width: 84px; height: 84px; border-radius: 50%; background: #0b0f1a; border: 4px solid #fff; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 900; font-style: italic; box-shadow: 0 10px 30px rgba(0,0,0,.5); }

/* --- Échelle ---------------------------------------------------------------- */
.spx-scale { display: flex; align-items: flex-end; gap: 34px; }
.spx-avg { display: flex; flex-direction: column; align-items: center; min-width: 170px; }
.spx-avg b { font-size: 96px; font-weight: 900; line-height: 1; color: var(--spx-accent); }
.spx-avg small { font-size: 22px; color: #94a3b8; font-weight: 800; }
.spx-avg span { font-size: 14px; text-transform: uppercase; letter-spacing: .16em; color: #cbd5e1; font-weight: 800; margin-top: 6px; }
.spx-sc-chart { flex: 1; display: flex; align-items: flex-end; gap: 10px; height: 220px; }
.spx-sc-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.spx-sc-bar { width: 100%; min-height: 4px; border-radius: 10px 10px 4px 4px; background: var(--spx-accent); display: flex; justify-content: center; transition: height .8s cubic-bezier(.2,.8,.2,1); position: relative; }
.spx-sc-bar span { position: absolute; top: -28px; font-weight: 800; font-size: 18px; color: #e2e8f0; }
.spx-sc-label { margin-top: 8px; font-weight: 900; font-size: 20px; color: #cbd5e1; }
.spx-sc-legend { display: flex; justify-content: space-between; margin-top: 14px; font-size: 15px; color: #94a3b8; font-weight: 700; }

/* --- Nuage de mots ---------------------------------------------------------- */
.spx-cloud { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 18px; min-height: 260px; padding: 10px 0; }
.spx-word { font-weight: 800; line-height: 1.05; display: inline-block; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.spx-word.is-rot { writing-mode: vertical-rl; transform: rotate(180deg); }
.has-anim .spx-word { animation: spx-pop .6s cubic-bezier(.2,1.4,.4,1) both; }

/* --- Classement ------------------------------------------------------------- */
.spx-lb { width: 760px; }
.spx-lb-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; background: rgba(255,255,255,.04); margin-bottom: 8px; font-size: 22px; font-weight: 700; }
.spx-lb-rank { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; font-weight: 900; }
.spx-lb-row.is-top1 .spx-lb-rank { background: #f59e0b; color: #1c1003; }
.spx-lb-row.is-top2 .spx-lb-rank { background: #cbd5e1; color: #0f172a; }
.spx-lb-row.is-top3 .spx-lb-rank { background: #b45309; color: #fff; }
.spx-lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spx-lb-good { color: #4ade80; font-size: 16px; }
.spx-lb-score { color: var(--spx-accent); font-weight: 900; font-variant-numeric: tabular-nums; min-width: 110px; text-align: right; }
.has-anim .spx-lb-row { animation: spx-slide .5s both; }
.has-anim .spx-lb-row:nth-child(2) { animation-delay: .08s; } .has-anim .spx-lb-row:nth-child(3) { animation-delay: .16s; }
.has-anim .spx-lb-row:nth-child(4) { animation-delay: .24s; } .has-anim .spx-lb-row:nth-child(5) { animation-delay: .32s; }

/* --- QR / rejoindre ---------------------------------------------------------- */
.spx-qr { background: #fff; padding: 12px; border-radius: 16px; display: inline-block; line-height: 0; }
.spx-qr img, .spx-qr canvas { display: block; }
.spx-joincard { width: 520px; text-align: center; padding: 36px 30px 0; }
.spx-join-title { font-size: 30px; font-weight: 800; margin-bottom: 20px; }
.spx-join-url { font-size: 24px; font-weight: 700; color: #cbd5e1; margin-top: 16px; }
.spx-join-code { font-size: 64px; font-weight: 900; letter-spacing: .16em; color: var(--spx-accent); margin: 6px 0 22px; font-variant-numeric: tabular-nums; }
.spx-joincard .spx-brand { margin: 0 -30px; }
.spx-join-mini { display: flex; align-items: center; gap: 16px; padding: 0 36px 22px; font-size: 18px; color: #cbd5e1; line-height: 1.4; }
.spx-join-mini b { color: #fff; }

/* --- Présentation (vidéoprojecteur) ----------------------------------------- */
.spx-present { display: flex; gap: 48px; align-items: center; width: 1800px; }
.spx-present-main { flex: 1; min-width: 0; }
.spx-present .spx-card { width: 100%; transform: none; }
.spx-present .spx-question { font-size: 56px; }
.spx-present .spx-opt-label { font-size: 32px; }
.spx-present .spx-bar { height: 30px; }
.spx-present-side { width: 360px; text-align: center; background: rgba(15,23,42,.94); border-radius: 28px; padding: 30px 20px; border: 1px solid rgba(255,255,255,.08); font-family: var(--spx-font, 'Inter', sans-serif); }
.spx-participants { font-size: 22px; font-weight: 800; color: #e2e8f0; }

/* --- Thème : Barre stream (compacte, pour le bas de l'écran) ---------------- */
.spx-theme-bar { width: 1200px; border-radius: 18px; }
.spx-theme-bar .spx-head { padding: 18px 26px 6px; display: flex; align-items: center; gap: 18px; }
.spx-theme-bar .spx-meta { margin: 0; order: 2; margin-left: auto; font-size: 12px; }
.spx-theme-bar .spx-question { font-size: 28px; }
.spx-theme-bar .spx-body { padding: 8px 26px 18px; }
.spx-theme-bar .spx-opts { flex-direction: row; gap: 14px; }
.spx-theme-bar .spx-opt { flex: 1 1 0; min-width: 0; }
.spx-theme-bar .spx-opt-label { font-size: 18px; margin-bottom: 6px; }
.spx-theme-bar .spx-opt-val b { font-size: 20px; }
.spx-theme-bar .spx-key { width: 26px; height: 26px; font-size: 13px; }
.spx-theme-bar .spx-bar { height: 14px; }
.spx-theme-bar .spx-vs { height: 150px; }
.spx-theme-bar .spx-vs-pct { font-size: 40px; }
.spx-theme-bar .spx-vs-name { font-size: 24px; }
.spx-theme-bar .spx-cloud { min-height: 140px; }
.spx-theme-bar .spx-sc-chart { height: 120px; }
.spx-theme-bar .spx-avg b { font-size: 60px; }

/* --- Thème : Néon ----------------------------------------------------------- */
.spx-theme-neon { background: rgba(6,6,20,.92); border: 2px solid var(--spx-accent); box-shadow: 0 0 40px rgba(139,92,246,.45), inset 0 0 40px rgba(139,92,246,.12); }
.spx-theme-neon .spx-question { text-shadow: 0 0 18px var(--spx-accent); }
.spx-theme-neon .spx-fill { box-shadow: 0 0 18px var(--c); }
.spx-theme-neon .spx-bar { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); }

/* --- Thème : Minimal -------------------------------------------------------- */
.spx-theme-minimal { background: transparent; border: none; box-shadow: none; text-shadow: 0 2px 10px rgba(0,0,0,.85); }
.spx-theme-minimal::before { display: none; }
.spx-theme-minimal .spx-bar { background: rgba(0,0,0,.35); }

/* --- Thème : Clair (classe / vidéoprojecteur) ------------------------------- */
.spx-theme-light { background: #ffffff; color: #0f172a; border-color: #e2e8f0; box-shadow: 0 26px 70px rgba(15,23,42,.18); }
.spx-theme-light .spx-question { color: #0f172a; }
.spx-theme-light .spx-meta, .spx-theme-light .spx-opt-val small, .spx-theme-light .spx-sc-legend { color: #64748b; }
.spx-theme-light .spx-total { color: #334155; }
.spx-theme-light .spx-bar { background: #f1f5f9; }
.spx-theme-light .spx-avg span, .spx-theme-light .spx-sc-label, .spx-theme-light .spx-sc-bar span { color: #334155; }
.spx-theme-light .spx-status { background: #f1f5f9; color: #334155; }
.spx-theme-light .spx-status.is-open { background: #dcfce7; color: #166534; }
.spx-theme-light .spx-lb-row { background: #f8fafc; }
.spx-theme-light .spx-word { text-shadow: none; }
.spx-theme-light .spx-hidden-results { background: #f1f5f9; color: #334155; }
.spx-theme-light .spx-brand { background: #f1f5f9; color: #64748b; }

/* --- Animations ------------------------------------------------------------- */
.spx-anchor:not(.has-anim) .spx-fill, .spx-anchor:not(.has-anim) .spx-vs-side, .spx-anchor:not(.has-anim) .spx-sc-bar { transition: none; }
.has-anim .spx-card { animation: spx-in .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes spx-in { 0% { opacity: 0; margin-top: 24px; } 100% { opacity: 1; margin-top: 0; } }
@keyframes spx-pop { 0% { opacity: 0; transform: scale(.4); } 100% { opacity: 1; transform: scale(1); } }
.has-anim .spx-word.is-rot { animation: none; }
@keyframes spx-slide { 0% { opacity: 0; margin-left: -40px; } 100% { opacity: 1; margin-left: 0; } }
@keyframes spx-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* --- Aperçu éditeur --------------------------------------------------------- */
.spx-preview { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 18px; border: 1px solid rgba(255,255,255,.08);
    background: radial-gradient(circle at 25% 70%, #1d3a2c 0%, transparent 55%), radial-gradient(circle at 75% 30%, #1e2a52 0%, transparent 50%), linear-gradient(135deg, #0b1220, #18233d); }
.spx-preview.is-transparent { background: repeating-conic-gradient(#1e293b 0% 25%, #0f172a 0% 50%) 50% / 28px 28px; }
.spx-preview.is-light { background: #e2e8f0; }
.spx-preview > .spx-stage { position: absolute; top: 0; left: 0; }

/* --- Thèmes des kits de stream (26/11/2026) : Verre et Rétro ------------------ */
.spx-theme-glass { background: rgba(255, 255, 255, .1); border: 1.5px solid rgba(255, 255, 255, .28); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 24px 70px rgba(0, 0, 0, .35); text-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.spx-theme-glass .spx-bar { background: rgba(255, 255, 255, .12); }
.spx-theme-glass .spx-meta { color: #e2e8f0; }
.spx-theme-retro { background: #000; border: 6px solid var(--spx-accent); border-radius: 0; box-shadow: 8px 8px 0 rgba(0, 0, 0, .55); }
.spx-theme-retro::before { display: none; }
.spx-theme-retro .spx-question { font-family: 'Press Start 2P', monospace; font-size: 26px; line-height: 1.5; color: #fde047; text-shadow: 3px 3px 0 #b91c1c; }
.spx-theme-retro .spx-meta { font-family: 'Press Start 2P', monospace; font-size: 10px; letter-spacing: 0; }
.spx-theme-retro .spx-bar, .spx-theme-retro .spx-fill { border-radius: 0; }
.spx-theme-retro .spx-bar { border: 3px solid rgba(255, 255, 255, .35); background: #111; }
.spx-theme-retro .spx-key { border-radius: 0; }
