/* Quizzaboum — style cartoon commun */
:root {
  --ink: #1b1240;
  --bg1: #6c3ef5;
  --bg2: #9b5cff;
  --bg3: #ff7ac6;
  --paper: #fffaf0;
  --yellow: #FFD43B;
  --pink: #ff8fb8;
  --good: #40c057;
  --bad: #fa5252;
  --a0: #FF6B6B; --a1: #4DABF7; --a2: #40c057; --a3: #FCA311;
  --shadow: 0.35rem 0.35rem 0 var(--ink);
  --title: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Fredoka', 'Nunito', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--bg1);
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,.14) 0 12%, transparent 13%),
    radial-gradient(circle at 85% 75%, rgba(255,255,255,.1) 0 16%, transparent 17%),
    linear-gradient(135deg, var(--bg1), var(--bg2) 55%, var(--bg3));
  background-attachment: fixed;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ---- Décor flottant ---- */
.decor { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.decor-item { position: absolute; opacity: .22; animation: floaty linear infinite; }
.decor-item svg { width: 100%; height: 100%; fill: var(--c); stroke: var(--c); }
@keyframes floaty {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  25% { transform: translate(30px, -40px) rotate(40deg) scale(1.1); }
  50% { transform: translate(-20px, -80px) rotate(90deg) scale(.95); }
  75% { transform: translate(-40px, -30px) rotate(140deg) scale(1.05); }
  100% { transform: translate(0, 0) rotate(180deg) scale(1); }
}
.confetti-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 100; }

/* ---- Éléments cartoon ---- */
.card {
  background: var(--paper);
  border: 0.25rem solid var(--ink);
  border-radius: 1.4rem;
  box-shadow: var(--shadow);
}
.btn {
  font-family: var(--title);
  font-size: 1.4rem;
  letter-spacing: .02em;
  padding: .7em 1.5em;
  border: 0.22rem solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  box-shadow: 0 .3rem 0 var(--ink);
  transition: transform .08s, box-shadow .08s, filter .15s;
  white-space: nowrap;
  user-select: none;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-2px); box-shadow: 0 .42rem 0 var(--ink); }
.btn:active { transform: translateY(.25rem); box-shadow: 0 .05rem 0 var(--ink); }
.btn:disabled { filter: grayscale(.7) opacity(.7); cursor: not-allowed; transform: none; }
.btn.pink { background: var(--pink); }
.btn.white { background: #fff; }
.btn.small { font-size: 1rem; padding: .45em 1em; }
.pill {
  display: inline-flex; align-items: center; gap: .4em;
  font-family: var(--title); background: #fff; border: .2rem solid var(--ink);
  border-radius: 999px; padding: .3em .9em; box-shadow: 0 .22rem 0 var(--ink);
}

/* Logo animé */
.logo { font-family: var(--title); color: var(--yellow); line-height: 1; white-space: nowrap;
  -webkit-text-stroke: .08em var(--ink); paint-order: stroke fill;
  text-shadow: .06em .08em 0 var(--ink); letter-spacing: .02em; }
.logo span { display: inline-block; animation: wiggle 2.4s ease-in-out infinite; }
.logo span:nth-child(odd) { color: #fff; }
.logo .bang { color: var(--a0); }
@keyframes wiggle { 0%, 100% { transform: translateY(0) rotate(0); } 20% { transform: translateY(-.12em) rotate(-6deg); } 40% { transform: translateY(0) rotate(4deg); } }

/* Mascotte : Boumi la bombe */
.mascot { position: relative; }
.mascot-svg { width: 100%; height: auto; overflow: visible; display: block; }
.mascot .m-body { transform-origin: 112px 228px; animation: bounce 1.1s cubic-bezier(.5,0,.5,1) infinite; }
.mascot .m-shadow { transform-origin: 112px 236px; animation: shadow 1.1s cubic-bezier(.5,0,.5,1) infinite; }
.mascot .m-eye { transform-box: fill-box; transform-origin: center; animation: blink 4.2s infinite; }
.mascot .m-arm-l { transform-origin: 44px 150px; animation: waveL 1.1s ease-in-out infinite; }
.mascot .m-arm-r { transform-origin: 180px 150px; animation: waveR 1.1s ease-in-out infinite; }
.mascot .m-ball { transition: fill .4s; }
.mascot .m-spark-in { transform-box: fill-box; transform-origin: center; animation: spark .14s linear infinite alternate; }
.mascot .m-brows, .mascot .m-mouth-nervous, .mascot .m-mouth-wow, .mascot .m-sweat, .mascot .m-party { display: none; }
.mascot.nervous .m-mouth-happy, .mascot.wow .m-mouth-happy { display: none; }
.mascot.nervous .m-mouth-nervous, .mascot.nervous .m-sweat, .mascot.nervous .m-brows { display: block; }
.mascot.nervous .m-body { animation: shiver .18s linear infinite; }
.mascot.nervous .m-sweat { animation: drip 1s ease-in infinite; }
.mascot.hot .m-ball { fill: #c92a2a; }
.mascot.hot .m-body { animation: shiver .07s linear infinite; }
.mascot.wow .m-mouth-wow { display: block; }
.mascot.party .m-party { display: block; }
.mascot.party .m-body { animation: jump .6s cubic-bezier(.3,0,.4,1) infinite; }
.mascot.party .m-arm-l, .mascot.party .m-arm-r { animation-duration: .3s; }
.mascot.nofuse .m-fuse, .mascot.nofuse .m-fuse-dots, .mascot.nofuse .m-spark { display: none; }
@keyframes spark { from { transform: scale(.8) rotate(0deg); } to { transform: scale(1.25) rotate(25deg); } }
@keyframes bounce { 0%, 100% { transform: translateY(0) scale(1.04, .96); } 50% { transform: translateY(-10px) scale(.97, 1.03); } }
@keyframes jump { 0%, 100% { transform: translateY(0) scale(1.08, .92); } 45% { transform: translateY(-26px) scale(.95, 1.06) rotate(-4deg); } }
@keyframes shadow { 0%, 100% { transform: scale(1); } 50% { transform: scale(.8); opacity: .7; } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@keyframes waveL { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-18deg); } }
@keyframes waveR { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(18deg); } }
@keyframes shiver { 0% { transform: translateX(-1.5px); } 50% { transform: translateX(1.5px); } 100% { transform: translateX(-1.5px); } }
@keyframes drip { 0% { transform: translateY(-4px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }

/* Explosion */
.boom-layer { position: fixed; inset: 0; z-index: 90; pointer-events: none; display: grid; place-items: center; }
.boom-flash { position: absolute; inset: 0; background: #fff; animation: flash .6s ease-out forwards; }
.boom-svg { width: min(80vw, 110vh); position: relative; animation: boomIn 1.6s cubic-bezier(.2,1.6,.4,1) forwards; }
.boom-smoke { position: absolute; left: 50%; top: 50%; width: 30vmin; height: 30vmin; margin: -15vmin; border-radius: 50%; background: #e9ecef; border: .3rem solid var(--ink); animation: smoke 1.4s ease-out forwards; }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }
@keyframes boomIn { 0% { transform: scale(.1) rotate(-20deg); opacity: 0; } 15% { transform: scale(1.15) rotate(4deg); opacity: 1; } 30% { transform: scale(1) rotate(0); } 75% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes smoke { 0% { transform: translate(0,0) scale(.2); opacity: 0; } 20% { opacity: .95; } 100% { transform: translate(var(--dx), var(--dy)) scale(1.4); opacity: 0; } }
.shake-screen { animation: screenShake .6s; }
@keyframes screenShake { 0%,100% { transform: none; } 10% { transform: translate(-18px, 10px) rotate(-1deg); } 25% { transform: translate(16px, -12px) rotate(1deg); } 40% { transform: translate(-12px, 8px); } 60% { transform: translate(8px, -6px); } 80% { transform: translate(-4px, 3px); } }
.poof { animation: poof .9s cubic-bezier(.5,-0.4,.7,.5) forwards !important; }
@keyframes poof { 0% { transform: none; } 30% { transform: scale(1.25) rotate(-8deg); filter: brightness(1.4); } 100% { transform: translateY(-120px) scale(.2) rotate(40deg); opacity: 0; } }

/* Avatars */
.avatar { display: inline-block; }
.avatar-svg { width: 100%; height: 100%; overflow: visible; display: block; }

/* Réponses */
.ans { --c: var(--a0); background: var(--c); color: #fff; border: .25rem solid var(--ink); border-radius: 1.2rem;
  box-shadow: 0 .35rem 0 var(--ink); display: flex; align-items: center; gap: .8em; text-align: left;
  font-family: var(--title); text-shadow: 0 .08em 0 rgba(27,18,64,.55); position: relative; overflow: hidden; }
.ans .shape { flex: none; width: 2.2em; height: 2.2em; }
.ans .shape svg { width: 100%; height: 100%; display: block; }
.ans.c0 { --c: var(--a0); } .ans.c1 { --c: var(--a1); } .ans.c2 { --c: var(--a2); } .ans.c3 { --c: var(--a3); }

/* Animations d'apparition */
.pop { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.slide-up { animation: slideUp .5s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes slideUp { 0% { transform: translateY(60px); opacity: 0; } 100% { transform: none; opacity: 1; } }
.shake { animation: shake .5s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-10px) rotate(-2deg); } 40%, 80% { transform: translateX(10px) rotate(2deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes spin { to { transform: rotate(360deg); } }

.screen { position: absolute; inset: 0; display: none; z-index: 1; }
.screen.active { display: flex; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* Mode QUESTION BOSS */
body.boss { --bg1: #2b0718; --bg2: #6e0f2c; --bg3: #e03131; }
body.boss .decor-item { opacity: .12; }
.katex { font-size: 1.08em; }

.credit { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 4px 12px max(5px, env(safe-area-inset-bottom)); text-align: center; font-size: 11px; font-weight: 600; line-height: 1.25; color: #fff; text-shadow: 0 1px 0 var(--ink); opacity: .85; pointer-events: none; }
.credit sup { font-size: .7em; }
body.host .credit { font-size: 1.35rem; padding: .2rem 1rem .3rem; }
