/* ============================================================
   QUIZ ARENA — ACCUEIL « ARÈNE » (v5.0)
   Chargé après theme.css. Ne touche que l'accueil et la nav.
   ============================================================ */
.arHome {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: calc(100vh - 120px);
  padding-top: max(2px, env(safe-area-inset-top));
}
.arHome button {
  font-family: inherit;
  cursor: pointer;
}
.arHome .arBanner,
.arHome .arSide,
.arHome .arModePick,
.arHome .arMini {
  color: #fff;
}

/* Barre de ressources */
.arTop {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 7px;
  align-items: center;
}
.arLevel,
.arRes {
  position: relative;
  height: 34px;
  border: 1px solid rgba(137, 116, 236, 0.5);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(28, 26, 82, 0.96), rgba(10, 11, 40, 0.98));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    0 6px 16px rgba(0, 0, 20, 0.35);
  display: flex;
  align-items: center;
  padding: 0 8px 0 4px;
}
.arLevel {
  padding-left: 0;
}
.arLvlBadge {
  position: relative;
  z-index: 2;
  flex: none;
  width: 40px;
  height: 40px;
  margin-left: -6px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #8c72ff, #5b3fd6);
  clip-path: polygon(50% 0, 100% 22%, 100% 70%, 50% 100%, 0 70%, 0 22%);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
}
.arLvlBadge b {
  font-size: 16px;
  font-weight: 950;
  color: #fff;
  text-shadow: 0 2px 0 #2a1668;
}
.arXp {
  position: relative;
  flex: 1;
  height: 14px;
  margin-left: -4px;
  border-radius: 0 7px 7px 0;
  background: #0b0a2a;
  overflow: hidden;
  border: 1px solid rgba(137, 116, 236, 0.35);
}
.arXp i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #45e7c2, #7d6bff);
}
.arXp em {
  position: relative;
  display: block;
  text-align: center;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 900;
  line-height: 13px;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}
.arRes {
  justify-content: space-between;
  gap: 4px;
}
.arResIc {
  flex: none;
  width: 28px;
  height: 28px;
  margin-left: -8px;
  display: grid;
  place-items: center;
}
.arResIc img,
.arResIc svg {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.45));
}
.arRes b {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: -0.2px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}
.arPlus {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-weight: 950;
  font-size: 14px;
  line-height: 1;
  color: #0d2a22;
  background: linear-gradient(180deg, #6ff5d4, #2fbf98);
}

/* Bannière joueur */
.arBannerRow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}
.arBanner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid rgba(137, 116, 236, 0.55);
  text-align: left;
  background-image:
    linear-gradient(90deg, rgba(15, 14, 53, 0.96), rgba(21, 16, 69, 0.86), rgba(10, 10, 39, 0.7)),
    url('assets/ui/planet-horizon.svg');
  background-size: cover;
  background-position: center;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(0, 0, 20, 0.35);
}
.arAvatar {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid #a78bfa;
  background: #1b1648;
  display: grid;
  place-items: center;
}
.arAvatar img,
.arAvatar svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.arName {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.arName b {
  font-size: 15px;
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}
.arName small {
  font-size: 11px;
  font-weight: 800;
  color: #b9a8ff;
}
.arRecord {
  flex: none;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px 3px 4px;
  border-radius: 10px;
  background: rgba(8, 8, 32, 0.75);
  border: 1px solid rgba(255, 200, 93, 0.35);
}
.arRecordIc {
  width: 22px;
  height: 22px;
  color: var(--gold);
  filter: drop-shadow(0 0 8px rgba(255, 200, 93, 0.55));
}
.arRecordIc svg {
  width: 22px;
  height: 22px;
}
.arRecord b {
  font-size: 17px;
  font-weight: 950;
  color: var(--gold);
  text-shadow: 0 2px 0 #3d2506;
}
.arSideBtns {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 120px;
}
.arMiniRow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.arMini {
  position: relative;
  height: 38px;
  border-radius: 11px;
  border: 1px solid rgba(137, 116, 236, 0.55);
  background: linear-gradient(180deg, #2c2a7a, #15134a);
  display: grid;
  place-items: center;
  color: #dcd4ff;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 4px 0 #0a0a2a;
}
.arMini svg {
  width: 20px;
  height: 20px;
}
.arMini.hot {
  color: var(--gold);
  border-color: rgba(255, 200, 93, 0.7);
}
.arDot,
.arBadge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 7px;
  background: #ff4d6d;
  color: #fff;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 950;
  line-height: 18px;
  text-align: center;
  box-shadow:
    0 2px 0 #7a1030,
    0 0 0 2px #0b0a2a;
}
.arPass {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: 1px solid rgba(255, 200, 93, 0.75);
  border-radius: 12px;
  padding: 3px 6px 6px;
  background: linear-gradient(180deg, #ffd77a, #e6a33a);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.5),
    0 4px 0 #6d4210;
}
.arPassTitle {
  font-size: 11px;
  font-weight: 950;
  color: #4a2a05;
  text-align: center;
  letter-spacing: 0.2px;
}
.arPassBar {
  display: flex;
  align-items: center;
  gap: 3px;
}
.arPassBar img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: none;
  margin-left: -3px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}
.arPassBar > span {
  position: relative;
  flex: 1;
  height: 14px;
  border-radius: 7px;
  background: #5b3608;
  overflow: hidden;
}
.arPassBar i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #ffe9a8, #fff);
}
.arPassBar em {
  position: relative;
  display: block;
  text-align: center;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 950;
  line-height: 14px;
  color: #fff;
  text-shadow: 0 1px 2px #3a2104;
}

/* Arène */
.arStage {
  position: relative;
  flex: 1;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 0 2px;
}
.arArena {
  position: relative;
  border: 0;
  background: none;
  padding: 0;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 900/565;
  display: block;
  margin-top: 40px;
}
.arArenaImg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 36px rgba(60, 40, 200, 0.5));
  animation: arFloat 6s ease-in-out infinite;
}
@keyframes arFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}
.arBubble {
  position: absolute;
  left: 50%;
  bottom: -6%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 88px;
  border-radius: 12px;
  overflow: hidden;
  background: #eef0ff;
  border: 2px solid #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 20, 0.5);
}
.arBubble:after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 50%;
  margin-left: -8px;
  border: 8px solid transparent;
  border-top-color: #eef0ff;
  border-bottom: 0;
}
.arBubble small {
  width: 100%;
  text-align: center;
  font-size: 10.5px;
  font-weight: 950;
  color: #4a2a05;
  background: linear-gradient(180deg, #ffd77a, #e6a33a);
  padding: 2px 0;
}
.arBubble img,
.arBubble svg {
  width: 44px;
  height: 44px;
  object-fit: contain;
  margin: 3px 0 0;
}
.arBubble em {
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
  color: #3c3489;
  padding-bottom: 4px;
}
.arProgress {
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(62%, 280px);
  margin-top: 26px;
}
.arShield {
  flex: none;
  width: 28px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 950;
  color: #0d2a22;
  background: linear-gradient(180deg, #6ff5d4, #2fbf98);
  clip-path: polygon(50% 0, 100% 18%, 100% 62%, 50% 100%, 0 62%, 0 18%);
}
.arShield.next {
  background: linear-gradient(180deg, #7b76b8, #3f3b7a);
  color: #fff;
}
.arProgBar {
  position: relative;
  flex: 1;
  height: 12px;
  border-radius: 6px;
  background: #0b0a2a;
  border: 1px solid rgba(137, 116, 236, 0.4);
  overflow: hidden;
}
.arProgBar i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #2fbf98, #6ff5d4);
}

/* Icônes latérales */
.arRail {
  position: absolute;
  top: 2px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.arRail.left {
  left: 0;
}
.arRail.right {
  right: 0;
}
.arSide {
  border: 0;
  background: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 70px;
}
.arSideArt {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(167, 139, 250, 0.75);
  background: linear-gradient(180deg, #2c2a7a, #131146);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 5px 0 #09092a,
    0 10px 20px rgba(0, 0, 20, 0.4);
  color: #dcd4ff;
}
.arSideArt.round {
  border-radius: 50%;
}
.arSideArt img {
  width: 84%;
  height: 84%;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.45));
}
.arSide.event .arSideArt {
  border-color: rgba(255, 200, 93, 0.85);
  overflow: hidden;
}
.arSide.event .arSideArt img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none;
}
.arSideArt svg {
  width: 30px;
  height: 30px;
}
.arSide.ready .arSideArt {
  border-color: #ffc85d;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.18),
    0 5px 0 #6d4210,
    0 0 22px rgba(255, 200, 93, 0.55);
  animation: arPulse 1.8s ease-in-out infinite;
}
@keyframes arPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}
.arSide small {
  font-size: 10.5px;
  font-weight: 950;
  color: #fff;
  text-shadow:
    0 1px 0 #000,
    0 0 6px #000;
  white-space: nowrap;
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.arSide .arBadge {
  top: -5px;
  right: -5px;
}

/* Sélecteur de mode + Combat */
.arCombatZone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}
.arModePick {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(74%, 300px);
  padding: 6px 12px 6px 6px;
  border-radius: 15px;
  border: 2px solid rgba(137, 116, 236, 0.7);
  background: linear-gradient(180deg, #34307f, #1a1752);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.14),
    0 5px 0 #0a0a2a;
  text-align: left;
}
.arModePick:after {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 50%;
  margin-left: -8px;
  border: 8px solid transparent;
  border-top-color: #0a0a2a;
  border-bottom: 0;
}
.arModePick img {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  object-fit: contain;
  flex: none;
  background: #0b0a2a;
}
.arModePick span:not(.arChev) {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.arModePick b {
  font-size: 16px;
  font-weight: 950;
}
.arModePick small {
  font-size: 11px;
  font-weight: 800;
  color: #b9a8ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.arChev {
  font-size: 14px;
  color: #dcd4ff;
}
.arCombatRow {
  display: grid;
  grid-template-columns: 74px 1fr 74px;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border-radius: 40px;
  background: linear-gradient(180deg, rgba(76, 56, 170, 0.55), rgba(20, 16, 70, 0.75));
  border: 1px solid rgba(167, 139, 250, 0.45);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.1);
}
.arRound {
  position: relative;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 3px solid #a78bfa;
  background: radial-gradient(circle at 50% 35%, #6f5bff, #3a2aa6 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: #fff;
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.25),
    0 5px 0 #1a1060;
}
.arRound svg {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}
.arRound small {
  font-size: 10px;
  font-weight: 950;
}
.arRound.gold {
  border-color: #ffc85d;
  color: #ffe29a;
}
.arRound .arBadge {
  top: -3px;
  right: -3px;
}
.arCombat {
  height: 72px;
  border-radius: 18px;
  border: 3px solid #ffe29a;
  background: linear-gradient(180deg, #ffd06a 0, #f5a623 55%, #e08a12 100%);
  font-size: 30px;
  font-weight: 950;
  letter-spacing: 0.5px;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  background-clip: padding-box;
  -webkit-background-clip: padding-box;
  text-shadow:
    0 3px 0 #7a4308,
    0 0 3px #7a4308,
    0 0 1px #7a4308;
  box-shadow:
    inset 0 3px rgba(255, 255, 255, 0.45),
    inset 0 -4px rgba(150, 80, 5, 0.35),
    0 6px 0 #7a4308,
    0 14px 30px rgba(255, 170, 40, 0.3);
}
.arCombat:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 3px rgba(255, 255, 255, 0.45),
    0 3px 0 #7a4308;
}
.arHome .buildTag {
  margin-top: 4px;
}

/* Liste des modes (fenêtre) */
.arModeList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.arModeCard {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(137, 116, 236, 0.45);
  background: linear-gradient(165deg, rgba(33, 30, 88, 0.94), rgba(13, 13, 48, 0.96));
  color: #f5f2ff;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.arModeCard.on {
  border-color: #ffc85d;
  box-shadow: 0 0 0 1px #ffc85d55;
}
.arModeCard img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: contain;
  flex: none;
}
.arModeCard span {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.arModeCard b {
  font-size: 16px;
}
.arModeCard small {
  font-size: 12px;
  color: #b9a8ff;
}
.arModeCard i {
  font-style: normal;
  color: #ffc85d;
  font-weight: 950;
}

/* Barre du bas : Jouer au centre */
nav.arenaNav {
  grid-template-columns: 1fr 1fr 1.35fr 1fr 1fr !important;
  overflow: visible;
}
nav.arenaNav button.navCenter {
  margin-top: -22px;
  min-height: 78px;
  border-radius: 20px;
  background: linear-gradient(180deg, #6f5bff, #3a2aa6);
  border: 2px solid #a78bfa;
  color: #fff;
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.25),
    0 -6px 20px rgba(111, 91, 255, 0.35);
}
nav.arenaNav button.navCenter svg {
  width: 30px;
  height: 30px;
}
nav.arenaNav button.navCenter small {
  font-size: 11px;
}
nav.arenaNav button.navCenter.active {
  background: linear-gradient(180deg, #ffd06a, #e08a12);
  border-color: #ffe29a;
  text-shadow: 0 2px 0 #7a4308;
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.4),
    0 -6px 24px rgba(255, 170, 40, 0.35);
}
nav.arenaNav button.navCenter.active:after {
  display: none;
}

@media (max-height: 780px) {
  .arArena {
    margin-top: 18px;
    max-width: 330px;
  }
  .arProgress {
    margin-top: 18px;
  }
  .arStage {
    min-height: 300px;
  }
  .arHome {
    gap: 8px;
  }
}
/* Fenêtre « Défier un ami » : réutilise .friendCard (normalement un
   simple <div> dans la liste d'amis) mais en <button> cliquable ici. */
.friendPickCard {
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: 10px;
}
.friendPickCard:active {
  background: rgba(255, 255, 255, 0.06);
}
.friendPickCard .fPending {
  color: #b9a8ff;
}

@media (max-width: 370px) {
  .arSide {
    width: 60px;
  }
  .arSideArt {
    width: 54px;
    height: 54px;
  }
  .arSideBtns {
    width: 118px;
  }
  .arCombat {
    font-size: 26px;
  }
  .arCombatRow {
    grid-template-columns: 64px 1fr 64px;
  }
  .arRound {
    width: 64px;
    height: 64px;
  }
}
