/* QUIZ'EM ALL v2.3.0 — MODULE SOCIAL « DÉFIER UN AMI » · Design System 5 (Magma / Gold / Steel)
   Couche 100 % additive, chargée APRÈS v2-design.css : aucun ID ni aucune classe existant touché.
   Préfixe exclusif .qe-ch-* · Animations : transform / opacity uniquement · prefers-reduced-motion respecté. */

/* ---------------------------------------------------------------------------------------------
   1. Boutons (⚔️ DÉFIER UN AMI · 🚀 ACCEPTER LE DÉFI · 🔁 Retenter · Fermer) — Or → Magma
   --------------------------------------------------------------------------------------------- */
.qe-ch-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  box-sizing: border-box;
  min-height: 48px;                       /* zone tactile */
  padding: 12px 24px;
  border-radius: 14px;
  border: 1px solid rgba(255, 233, 168, .75);
  font: 700 1.05rem/1.1 'Rajdhani', sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease, opacity .2s ease;
}
.qe-ch-btn--share,
.qe-ch-btn--accept {
  color: #1a0c02;
  background: linear-gradient(135deg, #fff1bd 0%, #f4c95d 34%, #ff8a3d 74%, #ff4d1a 100%);
  box-shadow: 0 8px 24px rgba(255, 77, 26, .32), 0 0 20px rgba(244, 201, 93, .28),
              inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -2px 6px rgba(120, 30, 0, .25);
}
.qe-ch-btn--retry {
  color: #fff4c9;
  background: linear-gradient(135deg, rgba(255, 77, 26, .85), rgba(168, 42, 8, .95));
  border-color: rgba(255, 138, 61, .8);
  box-shadow: 0 6px 18px rgba(255, 77, 26, .3), inset 0 1px 0 rgba(255, 190, 140, .4);
  min-height: 44px;
  padding: 10px 20px;
  font-size: .95rem;
}
.qe-ch-btn--ghost {
  color: #e6e9ee;
  background: linear-gradient(160deg, #2a2e36 0%, #1b1e24 55%, #23272e 100%);
  border-color: rgba(138, 146, 158, .4);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .12);
  font-weight: 600;
}
/* Reflet spéculaire qui balaie le bouton (survol / focus clavier) */
.qe-ch-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .42) 50%, transparent 65%);
  transform: translateX(-120%);
}
.qe-ch-btn:hover::after,
.qe-ch-btn:focus-visible::after { transform: translateX(120%); transition: transform .7s ease; }
.qe-ch-btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.05); }
.qe-ch-btn:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.qe-ch-btn:focus-visible { outline: 2px solid var(--v2-gold-hi, #ffe9a8); outline-offset: 3px; }
.qe-ch-btn:disabled,
.qe-ch-btn.is-busy { opacity: .72; cursor: progress; }
.qe-ch-btn-ico { font-size: 1.2em; line-height: 1; }

/* ---------------------------------------------------------------------------------------------
   2. Bloc de fin de partie (Quiz · Blind Test · Défi du jour)
   --------------------------------------------------------------------------------------------- */
.qe-ch-share {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 560px;
  margin: 18px auto 14px;
  padding: 0 4px;
  text-align: center;
  animation: qeChPop .45s cubic-bezier(.2, 1.2, .3, 1) both;
}
/* Anti « tap fantôme » : les 900 premières ms, le bloc ignore le toucher (même esprit que QuizSessionGuard) */
.qe-ch-share.is-arming { pointer-events: none; }
.qe-ch-share .qe-ch-btn--share { width: 100%; max-width: 380px; }
.qe-ch-hint {
  margin: 0;
  font: 500 .82rem/1.35 'Roboto', sans-serif;
  color: var(--v2-steel, #8a929e);
}

/* Comparatif : 👑 gagné · 💀 perdu · 🤝 égalité */
.qe-ch-compare {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--v2-edge, rgba(244, 201, 93, .2));
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  backdrop-filter: blur(12px) saturate(180%);
}
.qe-ch-compare-text {
  margin: 0;
  font: 700 1.08rem/1.35 'Rajdhani', sans-serif;
  letter-spacing: .04em;
  overflow-wrap: anywhere;
}
.qe-ch-compare.is-win {
  background: linear-gradient(160deg, rgba(244, 201, 93, .3), rgba(120, 84, 12, .28));
  border-color: var(--v2-gold, #f4c95d);
  color: #fff4c9;
  box-shadow: 0 0 26px rgba(244, 201, 93, .5), inset 0 1px 0 rgba(255, 241, 189, .5);
}
.qe-ch-compare.is-loss {
  background: linear-gradient(160deg, rgba(255, 77, 26, .28), rgba(110, 16, 0, .4));
  border-color: var(--v2-magma, #ff4d1a);
  color: #ffd9c9;
  box-shadow: 0 0 22px rgba(255, 77, 26, .45), inset 0 1px 0 rgba(255, 138, 61, .4);
}
.qe-ch-compare.is-tie {
  background: linear-gradient(160deg, rgba(42, 46, 54, .85), rgba(18, 19, 24, .92));
  border-color: rgba(138, 146, 158, .55);
  color: #e6e9ee;
  box-shadow: 0 0 18px rgba(138, 146, 158, .25), inset 0 1px 0 rgba(255, 255, 255, .12);
}

/* ---------------------------------------------------------------------------------------------
   3. Modale « ⚔️ DÉFI REÇU ! » — hérite du verre sombre / liseré d'or de .vip-modal (v2-design.css)
   --------------------------------------------------------------------------------------------- */
.vip-modal.qe-ch-modal { z-index: calc(var(--v2-z-modal, 10100) + 20) !important; }
.qe-ch-content { max-width: 440px; text-align: center; }
.qe-ch-swords {
  font-size: 3.2rem;
  line-height: 1;
  margin: 2px 0 4px;
  filter: drop-shadow(0 0 16px rgba(244, 201, 93, .55)) drop-shadow(0 0 28px rgba(255, 77, 26, .35));
  animation: qeChFloat 3.4s ease-in-out infinite;
}
.qe-ch-kicker {
  margin: 0 0 2px;
  font: 700 .78rem/1 'Rajdhani', sans-serif;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--v2-steel, #8a929e);
}
.qe-ch-title {
  margin: 4px 0 10px;
  font: 700 1.9rem/1.1 'Rajdhani', sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.qe-ch-text {
  margin: 0 0 14px;
  font-size: 1.02rem;
  line-height: 1.5;
  color: #e6e9ee;
  overflow-wrap: anywhere;                 /* pseudo très long / sans espaces */
}
.qe-ch-name { color: var(--v2-gold-hi, #ffe9a8); }
.qe-ch-strong { color: #fff; }
.qe-ch-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0 0 18px;
  padding: 12px 10px;
  border-radius: 16px;
  background: rgba(10, 10, 15, .6);
  border: 1px solid var(--v2-edge, rgba(244, 201, 93, .2));
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .6), 0 0 22px rgba(244, 201, 93, .12);
}
.qe-ch-score-n {
  font: 700 2.6rem/1.05 'Rajdhani', sans-serif;
  background: var(--v2-gold-grad, linear-gradient(135deg, #fff1bd, #f4c95d 38%, #b8862b 70%, #f4c95d));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 12px rgba(244, 201, 93, .35));
}
.qe-ch-score-u {
  font: 600 .8rem/1.2 'Rajdhani', sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--v2-steel, #8a929e);
}
.qe-ch-actions { display: flex; flex-direction: column; gap: 10px; }
.qe-ch-actions .qe-ch-btn { width: 100%; }

/* ---------------------------------------------------------------------------------------------
   4. Animations (transform / opacity)
   --------------------------------------------------------------------------------------------- */
@keyframes qeChPop { 0% { opacity: 0; transform: translateY(12px) scale(.96); } 100% { opacity: 1; transform: none; } }
@keyframes qeChFloat { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-5px) rotate(2deg); } }

@media (max-width: 480px) {
  .qe-ch-title { font-size: 1.6rem; }
  .qe-ch-score-n { font-size: 2.2rem; }
  .qe-ch-share .qe-ch-btn--share { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .qe-ch-share, .qe-ch-swords { animation: none !important; }
  .qe-ch-btn, .qe-ch-btn::after { transition: none !important; }
  .qe-ch-btn:hover:not(:disabled), .qe-ch-btn:active:not(:disabled) { transform: none; }
}
