/* =========================
   Thème général Raid
   ========================= */

body.fv-theme-raid {
  min-height: 100vh;
  margin: 0;
  color: #f5f5ff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 0%, #2a1b5a 0, #0a0b1a 50%, #050608 100%);
  position: relative;
  overflow-x: hidden;
}

/* Fond animé (particules / lueurs) */
body.fv-theme-raid::before,
body.fv-theme-raid::after {
  content: "";
  position: fixed;
  inset: -100px;
  pointer-events: none;
  opacity: 0.45;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 0, 128, 0.2), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(0, 200, 255, 0.25), transparent 60%),
    radial-gradient(circle at 60% 10%, rgba(255, 255, 255, 0.12), transparent 40%);
  mix-blend-mode: screen;
  z-index: -2;
  animation: raidGlowShift 18s ease-in-out infinite alternate;
}

body.fv-theme-raid::after {
  opacity: 0.22;
  filter: blur(16px);
  animation-duration: 26s;
}

/* Anim fond */
@keyframes raidGlowShift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-10px, 10px, 0) scale(1.02);
  }
  100% {
    transform: translate3d(12px, -8px, 0) scale(1.04);
  }
}

/* =========================
   Layout
   ========================= */

.raid-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  box-sizing: border-box;
}

.raid-section {
  margin-top: 16px;
}

/* Cartes glassmorphism */

.raid-card {
  border-radius: 18px;
  padding: 16px 18px;
  background: linear-gradient(145deg, rgba(10, 10, 20, 0.92), rgba(18, 12, 32, 0.9));
  border: 1px solid rgba(155, 160, 255, 0.28);
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(14px);
}

/* Boss card en plus large */

.boss-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
  gap: 16px;
  align-items: center;
}

@media (max-width: 800px) {
  .boss-card {
    grid-template-columns: 1fr;
  }
}

/* =========================
   Boss visuel & anim
   ========================= */

.boss-left {
  display: flex;
  justify-content: center;
  align-items: center;
}

.boss-wrapper {
  position: relative;
  width: 260px;
  max-width: 100%;
  aspect-ratio: 4 / 5;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Aura derrière le boss */
.boss-wrapper::before {
  content: "";
  position: absolute;
  width: 150%;
  height: 150%;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 120, 0, 0.2), transparent 60%),
    radial-gradient(circle, rgba(0, 255, 200, 0.12), transparent 70%);
  filter: blur(10px);
  opacity: 0.9;
  mix-blend-mode: screen;
  animation: bossAuraPulse 2.8s ease-in-out infinite;
}

/* Image boss (fond transparent conseillé) */
.boss-image {
  position: relative;
  max-width: 82%;
  max-height: 90%;
  filter:
    drop-shadow(0 0 22px rgba(0, 0, 0, 0.9))
    drop-shadow(0 0 32px rgba(255, 184, 105, 0.7));
  transform-origin: 50% 100%;
  animation: bossBreath 3.6s ease-in-out infinite;
  transition: transform 0.18s ease-out;
}

/* Flash d'impact */
.boss-hit-flash {
  position: absolute;
  inset: 0;
  border-radius: 40% 60% 50% 50%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9), transparent 60%);
  mix-blend-mode: screen;
  filter: blur(3px);
}

/* Effet quand JS ajoute .hit à l'image */
.boss-image.hit {
  animation: none;
  transform: translate(-4px, 3px) scale(1.04) rotate(-1deg);
  filter:
    drop-shadow(0 0 26px rgba(255, 90, 90, 0.9))
    drop-shadow(0 0 44px rgba(255, 140, 0, 0.9));
}

/* Animations boss */

@keyframes bossBreath {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-6px) scale(1.02);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes bossAuraPulse {
  0% {
    transform: scale(0.98);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1.02);
    opacity: 0.85;
  }
}

/* =========================
   Infos boss & HP bar
   ========================= */

.boss-right h2 {
  margin: 0 0 6px;
  font-size: 1.6rem;
  letter-spacing: 0.03em;
}

.boss-description {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: rgba(230, 230, 255, 0.9);
}

.boss-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.boss-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(20, 20, 40, 0.95);
  border: 1px solid rgba(180, 190, 255, 0.36);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.boss-tag-bonus {
  background: radial-gradient(circle at 10% 0, rgba(255, 196, 0, 0.18), rgba(60, 20, 0, 0.95));
  border-color: rgba(255, 200, 120, 0.9);
  color: #ffe7b2;
}

/* HP bar */

.raid-hp-container {
  margin-top: 10px;
}

.raid-hp-bar {
  width: 100%;
  height: 22px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 140, 80, 0.7);
  background: linear-gradient(135deg, rgba(20, 10, 10, 0.95), rgba(18, 12, 24, 0.95));
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.8),
    0 10px 26px rgba(0, 0, 0, 0.9);
  position: relative;
}

.raid-hp-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ff0033, #ff7f00);
  box-shadow: 0 0 16px rgba(255, 80, 0, 0.85);
  transition: width 0.4s ease-out;
  transform-origin: left center;
  animation: hpGlow 1.4s ease-in-out infinite alternate;
}

/* Texture diagonale légère par-dessus la barre */
.raid-hp-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.16) 10%,
    transparent 40%,
    transparent 60%,
    rgba(255, 255, 255, 0.12) 90%
  );
  background-size: 200% 100%;
  mix-blend-mode: soft-light;
  opacity: 0.5;
  animation: hpSheen 2.7s linear infinite;
  pointer-events: none;
}

@keyframes hpGlow {
  0% {
    box-shadow: 0 0 10px rgba(255, 90, 0, 0.6);
  }
  100% {
    box-shadow: 0 0 20px rgba(255, 150, 0, 1);
  }
}

@keyframes hpSheen {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.raid-hp-text {
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: rgba(245, 235, 255, 0.95);
}

.raid-hp-percent {
  font-weight: 600;
  color: #ffcd7f;
}

/* Stats globales */

.raid-stats-global {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 12px;
  font-size: 0.86rem;
}

.raid-stats-global .label {
  color: rgba(200, 200, 230, 0.8);
}

/* =========================
   Bloc "Tes contributions"
   ========================= */

#raidPlayerSummary {
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.raid-player-details {
  list-style: none;
  padding: 0;
  margin: 0;
}

.raid-player-entry {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr 0.8fr;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
}

.raid-player-entry:last-child {
  border-bottom: none;
}

.rpe-date {
  color: rgba(200, 200, 240, 0.85);
}

.rpe-jeu {
  color: rgba(220, 220, 255, 0.9);
}

.rpe-degats {
  text-align: right;
  font-weight: 600;
  color: #ffb36a;
}

/* =========================
   Attaques
   ========================= */

.raid-attacks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.raid-attack-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-radius: 14px;
  padding: 10px 10px 9px;
  border: 1px solid rgba(160, 180, 255, 0.35);
  background: radial-gradient(circle at 0 0, rgba(120, 120, 255, 0.15), rgba(10, 10, 30, 0.96));
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition:
    transform 0.14s ease-out,
    box-shadow 0.14s ease-out,
    border-color 0.14s ease-out,
    background-position 0.25s ease-out;
  background-size: 200% 200%;
  background-position: 0% 0%;
}

.raid-attack-card:hover,
.raid-attack-card:focus-visible {
  outline: none;
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.8);
  border-color: rgba(220, 230, 255, 0.9);
  background-position: 100% 100%;
}

.raid-attack-main {
  display: flex;
  flex-direction: column;
}

.raid-attack-title {
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.raid-attack-sub {
  font-size: 0.78rem;
  color: rgba(205, 210, 255, 0.85);
}

.raid-attack-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.raid-badge {
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.72rem;
  background: rgba(20, 26, 60, 0.9);
  border: 1px solid rgba(160, 180, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.raid-badge-bonus {
  background: radial-gradient(circle at 10% 0, rgba(255, 194, 0, 0.28), rgba(60, 20, 0, 0.95));
  border-color: rgba(255, 210, 140, 0.95);
  color: #ffecca;
}

/* =========================
   Messages système
   ========================= */

.raid-message {
  margin-top: 6px;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.raid-message-info {
  background: linear-gradient(90deg, rgba(20, 30, 70, 0.96), rgba(10, 18, 40, 0.96));
  border: 1px solid rgba(120, 160, 255, 0.6);
}

.raid-message-warning {
  background: linear-gradient(90deg, rgba(70, 40, 10, 0.96), rgba(40, 20, 10, 0.96));
  border: 1px solid rgba(240, 190, 120, 0.9);
  color: #ffdfb6;
}

.raid-message-error {
  background: linear-gradient(90deg, rgba(80, 10, 20, 0.96), rgba(40, 10, 20, 0.96));
  border: 1px solid rgba(255, 130, 140, 0.95);
  color: #ffd4dc;
}

/* =========================
   Mode basse performance
   ========================= */

/* 
   Ajoute "fv-lowperf" sur <body> pour limiter les animations :
   <body class="fv-theme-raid fv-lowperf">
*/

body.fv-theme-raid.fv-lowperf::before,
body.fv-theme-raid.fv-lowperf::after {
  animation: none;
  opacity: 0.2;
}

body.fv-theme-raid.fv-lowperf .boss-wrapper::before {
  animation: none;
  opacity: 0.6;
}

body.fv-theme-raid.fv-lowperf .boss-image {
  animation: none;
}

body.fv-theme-raid.fv-lowperf .raid-hp-fill {
  animation: none;
}

body.fv-theme-raid.fv-lowperf .raid-hp-bar::after {
  animation: none;
}

/* Respect du prefers-reduced-motion (global) */

@media (prefers-reduced-motion: reduce) {
  body.fv-theme-raid::before,
  body.fv-theme-raid::after,
  .boss-wrapper::before,
  .boss-image,
  .raid-hp-fill,
  .raid-hp-bar::after {
    animation: none !important;
  }

  .raid-attack-card {
    transition: none;
  }
}
/* Quand un thème global est actif, on laisse le thème gérer le fond,
   et on coupe le fond "spécial raid" pour éviter la superposition. */



body.fv-theme-raid[class*="theme-"]::before,
body.fv-theme-raid[class*="theme-"]::after {
  display: none;
}
.fv-btn-home-glass {
  display: inline-block;
  padding: 10px 24px;
  margin-right: 1em;
  color: #fff;
  font-weight: 600;
  font-size: 1.15rem;

  text-decoration: none;

  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.06);

  backdrop-filter: blur(6px);
  box-shadow:
    0 0 12px rgba(0, 200, 255, 0.5),
    inset 0 0 10px rgba(255, 255, 255, 0.25);

  transition: 0.2s ease;
}

.fv-btn-home-glass:hover {
  box-shadow:
    0 0 18px rgba(0, 200, 255, 0.75),
    inset 0 0 16px rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

.fv-btn-home-glass:active {
  transform: scale(0.96);
}
.fv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 12px 20px;
  gap: 10px;

  width: 100%;
  box-sizing: border-box;
}

/* On aligne chaque bloc sur la même ligne */
.fv-header-left,
.fv-header-center,
.fv-header-right {
  display: flex;
  align-items: center;
}

/* Le centre (titre) prend l’espace libre pour rester au milieu */
.fv-header-center {
  flex: 1;
  justify-content: center;
}

/* Le bouton Accueil ne casse jamais la ligne */
.fv-btn-home-glass {
  white-space: nowrap;
}

/* Même chose pour le pseudo */
.player-info {
  white-space: nowrap;
}
.player-points {
  margin-left: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}
/* ===========================
   ÉCRAN BOSS KO
   =========================== */

body.raid-ko-open {
  overflow: hidden;
}

.raid-ko-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at top, rgba(110, 225, 255, 0.15), transparent 55%),
              radial-gradient(circle at bottom, rgba(180, 110, 255, 0.3), rgba(5, 0, 20, 0.95));
  backdrop-filter: blur(6px);
}

.raid-ko-overlay::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(
    from 210deg,
    rgba(110, 225, 255, 0.05),
    rgba(255, 255, 255, 0.15),
    rgba(180, 110, 255, 0.2),
    rgba(10, 0, 40, 0.4),
    rgba(110, 225, 255, 0.05)
  );
  mix-blend-mode: screen;
  opacity: 0.7;
  filter: blur(40px);
  animation: raidKoSpin 18s linear infinite;
}

.raid-ko-panel {
  position: relative;
  max-width: 520px;
  width: 100%;
  padding: 2.2rem 2.4rem;
  border-radius: 24px;
  background: radial-gradient(circle at top, rgba(35, 10, 80, 0.95), rgba(5, 0, 20, 0.98));
  border: 1px solid rgba(140, 230, 255, 0.7);
  box-shadow:
    0 0 35px rgba(120, 220, 255, 0.4),
    0 0 120px rgba(180, 110, 255, 0.4);
  color: #f7fbff;
  text-align: center;
  animation: raidKoPop 0.6s ease-out;
}

.raid-ko-title {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.4rem;
}

.raid-ko-title-small {
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.75;
}

.raid-ko-title-main {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow:
    0 0 12px rgba(110, 225, 255, 0.9),
    0 0 28px rgba(180, 110, 255, 0.9);
}

.raid-ko-boss-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.raid-ko-global {
  font-size: 0.98rem;
  margin-bottom: 0.4rem;
}

.raid-ko-player {
  font-size: 0.98rem;
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.raid-ko-hint {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 1.6rem;
}

.raid-ko-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

.raid-ko-actions .fv-btn-primary,
.raid-ko-actions .fv-btn-secondary {
  min-width: 180px;
}

/* Si tu as déjà ces classes, elles seront réutilisées */
.fv-btn-primary {
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  border: none;
  cursor: pointer;
}

.fv-btn-secondary {
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  text-decoration: none;
}

/* Animations */

@keyframes raidKoPop {
  0% {
    transform: translateY(12px) scale(0.9);
    opacity: 0;
  }
  60% {
    transform: translateY(0) scale(1.03);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes raidKoSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
#bossTheme,
#bossBonus {
  display: none !important;
}