/* Quiz Arena — scènes animées des duels (thème « Pop clair »).
   Chargement : deux personnages face à face + barre d'émotes favorites.
   Résultat : plein écran, sans bulles de profil. */
.auraBattle {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 560px;
  margin: 12px auto 4px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 0 4px;
  box-sizing: border-box;
}
.auraFighter {
  position: relative;
  min-width: 0;
  text-align: center;
  --rim: #ff8fa3;
}
.auraFighter.foe {
  --rim: #7aa7ff;
}
.auraStage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.15;
  max-width: 230px;
  margin: 0 auto;
  isolation: isolate;
}
.auraCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  filter: drop-shadow(0 6px 6px rgba(80, 50, 20, 0.22));
  pointer-events: none;
}
.auraFallback {
  position: absolute;
  top: 16%;
  left: 18%;
  width: 64%;
  height: 66%;
  object-fit: contain;
  z-index: 2;
  display: none;
}
.auraCanvas:not([data-ready='true']) + .auraFallback,
.auraCanvas[data-fallback='true'] + .auraFallback {
  display: block;
}
.auraCanvas[data-fallback='true'] {
  visibility: hidden;
}
.auraGround {
  position: absolute;
  z-index: 1;
  bottom: 13%;
  left: 24%;
  width: 52%;
  height: 6%;
  border-radius: 50%;
  background: rgba(120, 80, 50, 0.45);
  filter: blur(5px);
  opacity: 0.5;
}
.auraHalo {
  position: absolute;
  z-index: 0;
  inset: 16% 10% 14%;
  border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--rim) 30%, transparent), transparent 68%);
}
.auraFighter.auraEmote .auraHalo {
  animation: auraEmoteHalo 0.9s ease-out;
}
@keyframes auraEmoteHalo {
  0% {
    transform: scale(0.8);
    opacity: 0.4;
  }
  40% {
    transform: scale(1.12);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.auraVs {
  align-self: center;
  margin-bottom: 44px;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 1px;
  color: #ff6b6b;
}
.auraIdentity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 4px;
}
.auraIdentity b {
  font-size: 14px;
  color: #23203a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auraIdentity small {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted, #7a7390);
}

/* Barre d'émotes favorites (chargement du duel) */
.emoteBarre {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 6px auto 10px;
  max-width: 420px;
}
.emoteBarre.vide small {
  display: block;
  text-align: center;
  color: var(--muted, #7a7390);
  font-size: 12px;
  padding: 8px 12px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(80, 50, 20, 0.08);
}
.emoteBouton {
  flex: 1 1 0;
  max-width: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 4px 7px;
  background: #ffffff;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(80, 50, 20, 0.12);
  font: inherit;
  color: #23203a;
  cursor: pointer;
  transition: transform 0.12s;
}
.emoteBouton:active,
.emoteBouton.joue {
  transform: scale(0.92);
  box-shadow: 0 0 0 2px #ff6b6b, 0 6px 16px rgba(255, 107, 107, 0.25);
}
.emoteBouton .emoteIc {
  width: 34px;
  height: 34px;
}
.emoteBouton small {
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.1;
  color: #23203a !important;
}

/* ---------- Fin de duel : plein écran ---------- */
.auraPhase-result {
  max-width: 640px;
  min-height: calc(100dvh - 120px);
  margin: 0 auto 10px;
  align-items: center;
  grid-template-rows: auto 1fr;
}
.auraTitre {
  grid-column: 1 / -1;
  text-align: center;
  padding-top: 4px;
}
.auraTitre h1 {
  margin: 2px 0 0;
  font-size: 34px;
  font-weight: 900;
  color: #23203a;
}
.auraPhase-result .auraStage {
  max-width: none;
  aspect-ratio: 1 / 1.45;
}
.auraPhase-result .auraVs {
  margin-bottom: 0;
  font-size: 13px;
  opacity: 0.6;
}
.auraPhase-result .auraIdentity b {
  font-size: 16px;
}
.auraPhase-result .auraIdentity small {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
/* Gagnant : grande aura dorée, rayons qui tournent */
.auraWinner .auraHalo {
  inset: 2% -6% 6%;
  background:
    radial-gradient(ellipse at 50% 55%, rgba(255, 214, 102, 0.85), rgba(255, 170, 90, 0.35) 45%, transparent 70%);
  animation: auraGagnant 1.6s ease-in-out infinite;
}
.auraWinner .auraHalo::after {
  content: '';
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 200, 80, 0.28) 0 10deg, transparent 10deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 35%, transparent 70%);
  mask: radial-gradient(circle, #000 35%, transparent 70%);
  animation: auraRayons 9s linear infinite;
}
.auraWinner .auraCanvas {
  filter: drop-shadow(0 0 10px rgba(255, 196, 81, 0.75)) drop-shadow(0 8px 8px rgba(80, 50, 20, 0.2));
}
.auraWinner .auraIdentity small {
  color: #c77700 !important;
}
@keyframes auraGagnant {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}
@keyframes auraRayons {
  to {
    transform: rotate(360deg);
  }
}
/* Perdant : décoloré, plus petit, petit nuage de pluie au-dessus */
.auraLoser .auraHalo {
  background: radial-gradient(ellipse, rgba(140, 150, 175, 0.25), transparent 65%);
}
.auraLoser .auraCanvas,
.auraLoser .auraFallback {
  filter: grayscale(0.75) brightness(0.9) drop-shadow(0 4px 4px rgba(60, 60, 80, 0.2));
}
.auraLoser .auraStage {
  transform: scale(0.88);
  transform-origin: 50% 100%;
}
.auraLoser .auraIdentity small {
  color: #8b8aa0 !important;
}
.auraNuage {
  position: absolute;
  z-index: 4;
  top: 4%;
  left: 50%;
  width: 46%;
  height: 16%;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 30% 60%, #b9bfd0 0 28%, transparent 29%),
    radial-gradient(circle at 55% 40%, #c7ccda 0 34%, transparent 35%),
    radial-gradient(circle at 76% 62%, #b9bfd0 0 26%, transparent 27%);
  animation: auraNuage 3s ease-in-out infinite;
}
.auraNuage i {
  position: absolute;
  top: 78%;
  width: 3px;
  height: 10px;
  border-radius: 2px;
  background: #8fb0ff;
  animation: auraPluie 1s linear infinite;
}
.auraNuage i:nth-child(1) {
  left: 32%;
}
.auraNuage i:nth-child(2) {
  left: 52%;
  animation-delay: 0.35s;
}
.auraNuage i:nth-child(3) {
  left: 70%;
  animation-delay: 0.7s;
}
@keyframes auraNuage {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-46%) translateY(2px);
  }
}
@keyframes auraPluie {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateY(22px);
    opacity: 0;
  }
}
body.qa-reduced-motion .auraWinner .auraHalo,
body.qa-reduced-motion .auraWinner .auraHalo::after,
body.qa-reduced-motion .auraNuage,
body.qa-reduced-motion .auraNuage i {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .auraWinner .auraHalo,
  .auraWinner .auraHalo::after,
  .auraNuage,
  .auraNuage i {
    animation: none;
  }
}

/* Aperçu d'une émote (boutique, personnalisation) */
.auraSolo .auraStage {
  max-width: 200px;
  margin: 6px auto 8px;
  background: radial-gradient(ellipse at 50% 60%, #fff1df, transparent 70%);
}

/* ---------- Cartes d'émotes (boutique + personnalisation) ---------- */
.emoteGrille,
.qa-emote-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.emoteCarte {
  --rc: #5b8dff;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 24px 6px 10px;
  background: #ffffff;
  border: 0;
  border-radius: 14px;
  box-shadow: inset 0 -4px 0 var(--rc), 0 6px 16px rgba(80, 50, 20, 0.1);
  font: inherit;
  color: #23203a;
  cursor: pointer;
}
.emoteCarte.r-epi {
  --rc: #a66cff;
}
.emoteCarte.r-leg {
  --rc: #f5b83d;
}
.emoteCarte.verrou .emoteIc {
  opacity: 0.55;
}
.emoteCarte.fav {
  box-shadow: inset 0 0 0 2px #ff6b6b, inset 0 -4px 0 var(--rc), 0 6px 16px rgba(80, 50, 20, 0.1);
}
.emoteRar {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--rc);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 7px;
  white-space: nowrap;
}
.emoteIc {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}
.emoteIc svg {
  width: 100%;
  height: 100%;
  stroke-linecap: round;
}
.emoteCarte b {
  font-size: 12.5px;
  line-height: 1.15;
  text-align: center;
}
.emoteCarte small {
  font-size: 11px;
  color: var(--muted, #7a7390);
}
.emoteCarte.fav small {
  color: #ff6b6b !important;
  font-weight: 800;
}
.emotePrix {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 800;
  color: #23203a;
}
.emotePrix svg {
  width: 14px;
  height: 14px;
  stroke: none;
}

/* Personnalisation : 4 favorites */
.emoteSection {
  margin-top: 22px;
}
.emoteFavs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}
.emoteCase {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 86px;
  padding: 8px 4px;
  border-radius: 16px;
  font: inherit;
}
.emoteCase.pleine {
  background: #ffffff;
  border: 0;
  box-shadow: 0 0 0 2px #ff6b6b, 0 6px 16px rgba(255, 107, 107, 0.18);
  color: #23203a;
  cursor: pointer;
}
.emoteCase.pleine b {
  font-size: 11px;
  line-height: 1.1;
  text-align: center;
}
.emoteCase.pleine .emoteIc {
  width: 36px;
  height: 36px;
}
.emoteRetirer {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #23203a;
  color: #fff;
  font-style: normal;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
}
.emoteCase.vide {
  border: 2px dashed #ecd9c3;
  background: rgba(255, 255, 255, 0.5);
  color: #c4b3a0;
}
.emoteCase.vide span {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}
.emoteCase.vide small {
  font-size: 10px;
  color: #c4b3a0 !important;
}
.emoteVoir {
  margin-top: 12px;
}
.emoteFiche {
  text-align: center;
}

/* ---------- Duel : pas de croix (pas d'abandon en direct) ---------- */
.liveTopBar .liveReportBtn {
  margin-left: auto;
}

/* ---------- Fin de duel : tout tient sur un seul écran ---------- */
.resFit {
  position: fixed;
  inset: 0;
  z-index: 40;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: max(12px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  overflow: hidden;
  background: var(--bg, #fff7ec);
}
.resTete {
  flex: none;
  text-align: center;
}
.resTete .eyebrow {
  color: #ff6b6b !important;
}
.resTete h1 {
  margin: 2px 0 0;
  font-size: clamp(26px, 7.5vw, 34px);
  font-weight: 900;
  line-height: 1.05;
  color: #23203a !important;
}
.resFit .auraBattle.auraPhase-result {
  flex: 1 1 0;
  min-height: 0;
  margin: 0 auto;
  container-type: size;
  grid-template-rows: 1fr;
  align-items: center;
}
.resFit .auraPhase-result .auraStage {
  width: 100%;
  max-width: none;
  aspect-ratio: auto;
  /* Aussi grand que la place le permet, sans jamais couper le personnage */
  height: min(calc(100cqh - 46px), calc((100cqw - 34px) / 2 * 2));
}
.resFit .auraPhase-result .auraIdentity {
  gap: 0;
}
.resFit .auraPhase-result .auraIdentity b {
  font-size: 15px;
}
.resFit .auraPhase-result .auraVs {
  align-self: center;
  margin-bottom: 30px;
}
/* Score */
.resScore {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.resFit .resScore .liveSeat {
  flex: 1;
  max-width: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 8px 10px;
  border-radius: 16px;
  background: #ffffff !important;
  border: 2px solid transparent !important;
  box-shadow: 0 4px 14px rgba(80, 50, 20, 0.1) !important;
}
.resFit .resScore .liveSeat.winner {
  border-color: #f5b83d !important;
  box-shadow: 0 4px 16px rgba(245, 184, 61, 0.3) !important;
}
.resFit .resScore .liveSeat strong {
  font-size: 26px;
  font-weight: 900;
  line-height: 1.1;
  color: #23203a !important;
}
.resFit .resScore .liveSeat small {
  font-size: 11.5px;
  font-weight: 700;
  color: #7a7390 !important;
}
.resTiret {
  font-weight: 900;
  color: #b9b2c6;
}
.resAttente {
  flex: none;
  margin: -2px 0 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #7a7390;
}
/* Gains de la partie */
.resGains {
  flex: none;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.resGain {
  flex: 1;
  max-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 8px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(80, 50, 20, 0.08);
  animation: resGainIn 0.45s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
.resGain:nth-child(2) {
  animation-delay: 0.1s;
}
.resGain:nth-child(3) {
  animation-delay: 0.2s;
}
.resGain svg,
.resGain img {
  width: 22px;
  height: 22px;
  flex: none;
}
.resGain b {
  font-size: 15px;
  font-weight: 900;
  color: #23203a;
}
.resGain small {
  font-size: 11px;
  font-weight: 700;
  color: #7a7390;
}
.resGain.plus b {
  color: #2f9e5e;
}
.resGain.moins b {
  color: #e0524f;
}
@keyframes resGainIn {
  from {
    transform: scale(0.7);
    opacity: 0;
  }
}
/* Progression du Pass */
.resPass {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(80, 50, 20, 0.08);
  text-align: left;
  font: inherit;
  color: #23203a;
  cursor: pointer;
}
.resPassIc {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
}
.resPassIc svg {
  width: 100%;
  height: 100%;
}
.resPassTxt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.resPassTxt small {
  font-size: 11px;
  font-weight: 700;
  color: #7a7390;
}
.resPassTxt b {
  font-size: 14px;
  font-weight: 900;
}
.resPass .bar {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: #f1e4d4;
  overflow: hidden;
}
.resPass .bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8a5c, #ff6b6b);
  transition: width 1.1s cubic-bezier(0.3, 0.8, 0.3, 1);
}
.resPassXp {
  flex: none;
  font-size: 12px;
  font-weight: 800;
  color: #7a7390;
}
/* Boutons */
.resActions {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.resActions .primary {
  margin: 0;
  min-height: 48px;
}
.resActions2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.resActions2 button {
  margin: 0;
  padding: 0 8px;
  font-size: 14px;
  white-space: nowrap;
  min-height: 44px;
  width: 100%;
}
@media (max-height: 640px) {
  .resFit {
    gap: 6px;
  }
  .resTete h1 {
    font-size: 24px;
  }
  .resFit .resScore .liveSeat {
    padding: 5px 8px;
  }
  .resFit .resScore .liveSeat strong {
    font-size: 21px;
  }
  .resGain {
    padding: 5px 6px;
  }
  .resPass {
    padding: 6px 10px;
  }
}
