/* ================================================================
   dungeon.css — Styles communs à toutes les fiches de donjon
   v3 — Architecture propre, zéro inline style dans les HTML

   VARIABLES REQUISES dans le :root de chaque donjon :
   --theme-accent        Couleur principale (h2, accents, bordures actives)
   --theme-accent-rgb    Même couleur en RGB → ex: 232, 145, 58
   --theme-nav-*         Variables navbar (voir navbar.css)
   --theme-body-bg       Fond de page
   --theme-card-bg       Fond des cards
   --theme-card-border   Bordure des cards
   --theme-text          Texte principal
   --theme-meta          Texte secondaire / labels
   --theme-h1            Couleur du titre h1

   CE QUI RESTE LOCAL dans chaque HTML :
   - :root (couleurs du thème)
   - body { background } si différent de --theme-body-bg
   - h1 { text-shadow } (rgba unique par donjon)
   - .card:hover { box-shadow } (rgba unique par donjon)
   - .social-link:hover { box-shadow } (rgba unique par donjon)
   - Canvas animation (keyframes + script unique par donjon)
   - Barre déco top (gradient unique par donjon)
================================================================ */


/* ══════════════════════════════════════════════════════════════
   FONDATIONS
══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { background: #000; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  padding: 2rem 3rem;
  padding-top: 72px !important;
  background: var(--theme-body-bg);
  color: var(--theme-text);
  animation: pageFadeIn 0.35s ease forwards;
}

@keyframes pageFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes pageFadeOut { from { opacity: 1; } to { opacity: 0; } }
body.page-fade-out { animation: pageFadeOut 0.25s ease forwards; }


/* ══════════════════════════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════════════════════════ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 16px; }

@media (max-width: 900px) {
  .grid3, .grid4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
}


/* ══════════════════════════════════════════════════════════════
   TYPOGRAPHIE
══════════════════════════════════════════════════════════════ */

h1 {
  font-size: 34px;
  font-weight: 500;
  font-family: 'Uncial Antiqua', serif;
  color: var(--theme-h1);
  text-align: center;

}

h2 {
  font-size: 28px;
  font-weight: 500;
  color: var(--theme-accent);
  margin: 2rem 0 0.75rem;
  letter-spacing: 0.02em;
  text-align: center;
}

.meta {
  font-size: 12px;
  color: var(--theme-meta);
  margin-bottom: 6px;
  text-align: center;
}

.card-text {
  font-size: 15px;
  color: var(--theme-text);
}

.section-sep {
  border-top: 1px solid var(--theme-card-border);
  margin: 2rem 0 0;
  opacity: 0.5;
}


/* ══════════════════════════════════════════════════════════════
   CARD — Brique de base
══════════════════════════════════════════════════════════════ */

.card {
  background: var(--theme-card-bg);
  border: 0.5px solid var(--theme-card-border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;

}

.card.overflow-visible { overflow: visible; }


/* ══════════════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════════════ */

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 8px;
  margin-bottom: 8px;
}

/* Badges couleur pour noms de monstres / sections */
.badge-green  { background: #1a2e10; color: #7ec84a; }
.badge-amber  { background: #2e2010; color: #f0a830; }
.badge-red    { background: #2e1010; color: #f06060; }
.badge-coral  { background: #2e1a10; color: #f07840; }
.badge-blue   { background: #10182e; color: #60a0f0; }
.badge-purple { background: #1a102e; color: #a078f0; }
.badge-teal   { background: #102e28; color: #40c8a0; }
.badge-pink   { background: #2e1020; color: #e060a0; }
.badge-honey  { background: #1e1a04; color: #d4a030; }
.badge-gold   { background: #1a1206; color: #d4a030; border: 1px solid rgba(200,150,40,0.35); }

/* Badges info header (6 joueurs, 2 salles, résistances) */
.info-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 20px;
  background: var(--theme-card-bg);
  border: 0.5px solid var(--theme-card-border);
  color: var(--theme-meta);
}

.info-badge img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}


/* ══════════════════════════════════════════════════════════════
   HEADER — zone_dj.png + boss débordant
══════════════════════════════════════════════════════════════ */

.header-wrap {
  padding-top: 170px;
  position: relative;
  margin-bottom: 2rem;
}

.header-card {
  position: relative;
  overflow: visible;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 2rem;
  border: 0.5px solid var(--theme-card-border);
  text-align: center;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.header-card:hover {
  border-color: var(--theme-accent);
  transform: translateY(-2px);
}

.header-zone {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  border-radius: 16px;
  z-index: 0;
}

.header-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.6) 100%);
  border-radius: 16px;
  z-index: 1;
}

.header-boss {
  position: absolute;
  top: -140px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 320px;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;

}

.header-content {
  position: relative;
  z-index: 3;
  padding-top: 120px;
  padding-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-meta {
  font-size: 12px;
  color: var(--theme-meta);
  margin-bottom: 6px;
  text-shadow: 0 0 10px rgba(0,0,0,1), 0 0 25px rgba(0,0,0,1);
}

.header-title {
  text-shadow: 0 0 8px rgba(0,0,0,1), 0 0 20px rgba(0,0,0,1);
  /* text-shadow couleur défini localement */
}

.header-sub {
  font-size: 13px;
  color: var(--theme-meta);
  margin-top: 4px;
  text-shadow: 0 0 10px rgba(0,0,0,1);
}

.header-badges {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
  flex-wrap: wrap;
}


/* ══════════════════════════════════════════════════════════════
   RÉSISTANCES
══════════════════════════════════════════════════════════════ */

.res-block {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 8px;
  background: var(--theme-placeholder-bg);
  border-radius: 6px;
  border: 0.5px solid var(--theme-card-border);
  justify-content: center;
}

.res-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--theme-text);
}

.res-item img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

/* max = résistance la plus haute → VERT (favorable) */
.res-item.max { color: #7ec84a; }
/* min = résistance la plus basse → ROUGE (défavorable) */
.res-item.min { color: #ff6060; }


/* ══════════════════════════════════════════════════════════════
   MONSTRES
══════════════════════════════════════════════════════════════ */

.monsters-grid {
  padding-top: 40px; /* espace pour l'image débordante */
}

.monster-card {
  background: var(--theme-card-bg);
  border: 0.5px solid var(--theme-card-border);
  border-radius: 12px;
  padding: 1rem;
  padding-top: 90px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible;
  text-align: center;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.monster-img {
  position: absolute;
  top: -42px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
}

.monster-img img {
  width: 120px;
  height: 120px;
  object-fit: contain;

}

.monster-name {
  margin-bottom: 8px;
}

.monster-res {
  margin: 8px 0;
  display: flex;
  justify-content: center;
}

.monster-desc {
  font-size: 15px;
  color: var(--theme-text);
  margin-top: 8px;
  flex: 1;
}

.monster-condition {
  font-size: 12px;
  color: var(--theme-text);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 0.5px solid var(--theme-card-border);
}

.monster-detail-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--theme-accent);
  color: var(--theme-accent);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
  z-index: 2;
}

.monster-detail-btn:hover {
  background: var(--theme-accent);
  color: #0a0e08;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(var(--theme-accent-rgb), 0.4);
}

/* Système Popup Détails Monstres */
.monster-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(12px) brightness(0.6);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.monster-popup-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.monster-popup-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  pointer-events: none;
  overflow-y: auto;
}

.monster-popup-wrapper.active {
  pointer-events: all;
}

.monster-popup {
  background: var(--theme-card-bg);
  border: 2px solid var(--theme-accent);
  border-radius: 20px;
  max-width: 900px;
  width: 100%;
  max-height: 85vh;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  opacity: 0;
  transform: scale(0.1);
  transition: opacity 0.4s cubic-bezier(0.34,1.2,0.64,1), 
              transform 0.4s cubic-bezier(0.34,1.2,0.64,1);
}

.monster-popup-wrapper.active .monster-popup {
  opacity: 1;
  transform: scale(1);
}

.monster-popup-wrapper.animating .monster-popup {
  transform-origin: var(--popup-origin-x, 50%) var(--popup-origin-y, 50%);
}

.monster-popup-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: rgba(0,0,0,0.5);
  border: 2px solid var(--theme-accent);
  border-radius: 50%;
  color: var(--theme-accent);
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.monster-popup-close:hover {
  background: var(--theme-accent);
  color: #0a0e08;
  transform: rotate(90deg);
}

.monster-popup-img {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(0,0,0,0.3);
  padding: 0.5rem;
  border: 2px solid var(--theme-accent);
  z-index: 5;
  transition: all 0.4s cubic-bezier(0.34,1.2,0.64,1);
}

.monster-popup-wrapper.animating .monster-popup-img {
  transform: translate(
    calc(var(--popup-translate-x, 0px) * 0.5),
    calc(var(--popup-translate-y, 0px) * 0.5)
  ) scale(1.5);
}

.monster-popup-content {
  padding: 2rem 2rem 2rem 160px;
  max-height: calc(85vh - 4rem);
  overflow-y: auto;
  color: var(--theme-text);
}

.monster-popup-title {
  font-size: 24px;
  color: var(--theme-accent);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.monster-detail-section {
  margin-bottom: 1.5rem;
}

.monster-detail-section h4 {
  font-size: 16px;
  color: var(--theme-accent);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.monster-detail-section p {
  font-size: 14px;
  line-height: 1.6;
  color: #909870;
  margin-bottom: 0.5rem;
}

/* Placeholder par défaut */
.monster-placeholder {
  text-align: center;
  padding: 3rem 2rem;
  color: #909870;
  font-style: italic;
  line-height: 1.8;
  font-size: 15px;
}

.monster-placeholder::before {
  content: "🔬";
  display: block;
  font-size: 48px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Scrollbar popup (s'adapte au thème) */
.monster-popup-content::-webkit-scrollbar {
  width: 12px;
}

.monster-popup-content::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
}

.monster-popup-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, 
    rgba(var(--theme-accent-rgb), 0.6), 
    rgba(var(--theme-accent-rgb), 0.4));
  border-radius: 10px;
  border: 2px solid rgba(0,0,0,0.3);
}

.monster-popup-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, 
    rgba(var(--theme-accent-rgb), 0.8), 
    rgba(var(--theme-accent-rgb), 0.6));
}

.monster-popup-content {
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--theme-accent-rgb), 0.5) rgba(0,0,0,0.3);
}

/* Schémas de sorts */
.sort-schema {
  background: rgba(14,18,10,0.5);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.sort-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(144,152,112,0.15);
}

.sort-info h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.sort-cost {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: #909870;
}

.cost-item {
  background: rgba(144,152,112,0.1);
  padding: 3px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cost-icon {
  width: 12px;
  height: 12px;
  object-fit: contain;
}

.sort-grid {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.zone-visual {
  flex: 0 0 auto;
  background: #080c06;
  border: 1px solid rgba(144,152,112,0.2);
  border-radius: 6px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-pattern {
  display: grid;
  grid-template-columns: repeat(7, 16px);
  grid-template-rows: repeat(7, 16px);
  gap: 1px;
}

.cell {
  width: 16px;
  height: 16px;
  background: rgba(100,100,80,0.15);
  border: 0.5px solid rgba(100,100,80,0.2);
}

.cell.gray {
  background: rgba(144,152,112,0.25);
  border: 0.5px solid rgba(144,152,112,0.4);
}

.cell.caster {
  background: #4090d0;
  border-color: #5aa0e0;
  box-shadow: 0 0 6px rgba(64,144,208,0.6);
}

.cell.target {
  background: #d85050;
  border-color: #e86860;
  box-shadow: 0 0 6px rgba(216,80,80,0.6);
}

.cell.ally {
  background: #50c850;
  border-color: #60d860;
  box-shadow: 0 0 6px rgba(80,200,80,0.6);
}

.sort-effects {
  flex: 1;
}

.effects-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.effect-item {
  background: rgba(144,152,112,0.08);
  border-left: 2px solid #909870;
  padding: 6px 10px;
  margin-bottom: 5px;
  border-radius: 3px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.effect-value {
  font-weight: 600;
}

.effect-state {
  color: #7ab840;
}

.effect-state strong {
  font-weight: 700;
  color: #8ac850;
}

.effect-state em {
  font-style: italic;
  color: #6aa830;
}

.effect-state code {
  background: rgba(122,184,64,0.15);
  padding: 2px 4px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
}

.elem-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.crit-separator {
  text-align: center;
  color: #909870;
  font-size: 10px;
  margin: 6px 0;
  padding: 3px 0;
  border-top: 1px dashed rgba(144,152,112,0.3);
  border-bottom: 1px dashed rgba(144,152,112,0.3);
}


/* ══════════════════════════════════════════════════════════════
   MÉCANIQUE DU DONJON
══════════════════════════════════════════════════════════════ */

/* Utilise .card comme base + .card-text pour le texte */
/* Rien de spécifique — tout est géré par .card */


/* ══════════════════════════════════════════════════════════════
   MÉCANIQUE DU BOSS
══════════════════════════════════════════════════════════════ */

.boss-section {
  padding-top: 20px;
  position: relative;
}

.boss-card {
  background: var(--theme-card-bg);
  border: 0.5px solid var(--theme-card-border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: visible;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.boss-img-left {
  position: absolute;
  top: -117px;
  left: 50%;
  width: 234px;
  height: 234px;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;
  transform: translateX(-50%);
  /* filter défini localement */
}

.boss-layout {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.boss-stats {
  min-width: 160px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 100px;
  gap: 10px;
  position: relative;
}

.boss-content {
  flex: 1;
}

.boss-gifs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  width: 160px;
}


/* ══════════════════════════════════════════════════════════════
   PHASES
══════════════════════════════════════════════════════════════ */

.phase-bar {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  height: 8px;
  margin-bottom: 0.5rem;
  gap: 2px;
}

.ph1 { background: #3b6d11; flex: 3; border-radius: 8px 0 0 8px; }
.ph2 { background: #854f0b; flex: 4; }
.ph3 { background: #993c1d; flex: 3; border-radius: 0 8px 8px 0; }

.phase-label {
  display: flex;
  font-size: 11px;
  color: var(--theme-meta);
  margin-bottom: 1rem;
  gap: 12px;
}
.phase-label span:nth-child(1) { flex: 3; text-align: center; }
.phase-label span:nth-child(2) { flex: 4; text-align: center; }
.phase-label span:nth-child(3) { flex: 3; text-align: center; }


/* ══════════════════════════════════════════════════════════════
   ABORDER LE COMBAT
══════════════════════════════════════════════════════════════ */

/* Utilise .card comme base — section narrative, pas de layout spécifique */


/* ══════════════════════════════════════════════════════════════
   STÈLES
══════════════════════════════════════════════════════════════ */

/* H2 des stèles avec icône positionnée à gauche du titre */
.stele-h2 {
  position: relative;
  text-align: center;
}

.stele-h2-icon {
  position: absolute;
  right: calc(50% + 55px);
  top: 50%;
  transform: translateY(-50%);
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(var(--theme-accent-rgb), 0.3));
}

/* Card stèle — badge centré + texte, pas d'icône dans la card */
.stele-card {
  background: var(--theme-card-bg);
  border: 0.5px solid var(--theme-card-border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 0;
  text-align: center;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.stele-name {
  text-align: center;
  margin-bottom: 10px;
}

.stele-desc {
  font-size: 15px;
  color: var(--theme-text);
}


/* ══════════════════════════════════════════════════════════════
   SUBLIMATIONS — ligne horizontale unique avec rangs I/II/III
══════════════════════════════════════════════════════════════ */

.sublimation-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0.75rem 0 0.4rem;
}

.sublimation-inline-icon {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.6)) drop-shadow(0 0 12px rgba(255,255,255,0.3));
}

.sublimation-inline-text {
  font-size: 19px;
  font-weight: 500;
  color: var(--theme-meta);
}

.sublimation-inline-name {
  color: var(--theme-text);
  font-weight: 600;
}

/* Badges de rang I / II / III */
.sublimation-rank {
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 16px;
  background: var(--theme-card-bg);
  border: 0.5px solid var(--theme-card-border);
}
.sublimation-rank.rank-1 { color: #99d42b; }
.sublimation-rank.rank-2 { color: #e1a02c; }
.sublimation-rank.rank-3 { color: #fcfae2; }


/* ══════════════════════════════════════════════════════════════
   CONSEILS GÉNÉRAUX
══════════════════════════════════════════════════════════════ */

.focus-order {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0.5rem 0 1.5rem;
}

.focus-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
}

.focus-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--theme-card-border);
  color: var(--theme-text);
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.arrow {
  color: var(--theme-meta);
  font-size: 14px;
}

.tips-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tip-card {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
}

.tip-card-bar {
  width: 4px;
  flex-shrink: 0;
  background: var(--theme-accent);

}

.tip-card-body {
  background: var(--theme-placeholder-bg);
  padding: 10px 14px;
  flex: 1;
  border: 0.5px solid var(--theme-card-border);
  border-left: none;
  border-radius: 0 8px 8px 0;
}

.tip-card-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--theme-accent);
  margin-bottom: 3px;
}

.tip-card-text {
  font-size: 15px;
  color: var(--theme-text);
}

/* Tip inline (dans une card, sans barre) */
.tip {
  background: var(--theme-placeholder-bg);
  border-left: 2px solid var(--theme-accent);
  padding: 8px 12px;
  font-size: 15px;
  color: var(--theme-text);
  margin-top: 8px;
  border-radius: 0 4px 4px 0;
}


/* ══════════════════════════════════════════════════════════════
   STÈLE D'INTERVENTION — Anathar (doré) et Aguabrial (cyan)
   Ces deux styles sont FIXES — ne jamais modifier
══════════════════════════════════════════════════════════════ */

/* Base commune */
.card-intervention {
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: visible;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.intervention-layout {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.intervention-img {
  position: absolute;
  top: -80px;
  left: -20px;
  width: 240px;
  height: 240px;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;
  transition: filter 0.3s ease;
}

.intervention-stats {
  min-width: 180px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 140px;
  gap: 10px;
}

.intervention-content {
  flex: 1;
}

.intervention-gifs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  width: 160px;
}

.intervention-gif-card {
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.intervention-gif-label {
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 6px;
}

.intervention-gif-name {
  font-size: 10px;
  font-style: italic;
}




/* ══════════════════════════════════════════════════════════════
   IMAGES & PLACEHOLDERS
══════════════════════════════════════════════════════════════ */

.img-box {
  margin-top: 10px;
  border-radius: 8px;
  overflow: hidden;
}

.img-box img {
  width: 100%;
  display: block;
  border-radius: 8px;
}

.img-placeholder {
  background: var(--theme-placeholder-bg);
  border: 1px dashed var(--theme-card-border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--theme-meta);
  font-size: 12px;
  text-align: center;
  padding: 1rem;
  margin-top: 10px;
  min-height: 100px;
}

.img-placeholder span:last-child {
  font-size: 10px;
  opacity: 0.6;
}


/* ══════════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════════ */

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 0.5px solid var(--theme-card-border);
  font-size: 12px;
  color: var(--theme-meta);
  text-align: center;
}

.footer-socials {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
}

.social-link {
  display: inline-flex;
  text-decoration: none;
  border-radius: 8px;
  padding: 6px;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.social-link:hover {
  transform: translateY(-2px);
  /* box-shadow défini localement (rgba unique par donjon) */
}

.social-link img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}



/* ══════════════════════════════════════════════════════════════
   COULEURS SÉMANTIQUES DU JEU — identiques sur tous les donjons
   Utilisées pour les éléments, états, et alertes in-game
══════════════════════════════════════════════════════════════ */

/* Éléments */
.elem-fire  { color: #FFA97A; font-weight: 700; }
.elem-water { color: #66D6FF; font-weight: 700; }
.elem-earth { color: #9DD95D; font-weight: 700; }
.elem-air   { color: #DAC7FF; font-weight: 700; }

/* États / mots-clés du jeu (jaune Wakfu) */
.state-name { color: #f0c040; font-weight: 700; }

/* Danger / valeurs négatives */
.danger { color: #f06060; font-weight: 700; }

/* Accent du thème en gras */
.accent-bold { color: var(--theme-accent); font-weight: 700; }

/* Texte placeholder / à compléter */
.text-placeholder { color: var(--theme-meta); font-style: italic; }


/* ══════════════════════════════════════════════════════════════
   UTILITAIRES DE STRUCTURE
   Espacements et alignements récurrents dans les fiches
══════════════════════════════════════════════════════════════ */

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mb-4  { margin-bottom: 4px; }
.mb-6  { margin-bottom: 6px; }
.mb-8  { margin-bottom: 8px; }

/* Centrage avec marge basse (header de phase, de stèle) */
.card-badge-header {
  text-align: center;
  margin-bottom: 8px;
}

/* Label de section (ex: "Ordre de focus conseillé :") */
.section-label {
  font-size: 15px;
  color: var(--theme-meta);
  margin-bottom: 0.5rem;
}

/* Badge dans monster-name — taille standard */
.badge-monster {
  font-size: 14px;
  padding: 5px 14px;
  margin-bottom: 0;
}

/* Badge dans phase/stèle — taille standard */
.badge-section {
  font-size: 14px;
  padding: 5px 14px;
}

/* Badge stèle — légèrement plus petit */
.badge-stele {
  font-size: 13px;
  padding: 4px 12px;
}

/* Badge stèle d'intervention Aguabrial */
.badge-aguabrial {
  font-size: 14px;
  padding: 5px 14px;
  background: #0a2a2a;
  color: #1affcc;
  border: 1px solid var(--aguabrial-badge-border);
}

/* Icône emoji Roc (🧊🔥) */
.roc-icon { font-size: 22px; }

/* Titre dans une card de mécanique (Roc Froid / Roc Chaud) */
.roc-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  text-align: center;
}

/* Card Roc Froid */
.roc-froid {
  background: #0a1c28;
  border-color: #1a3a4a;
  flex-direction: column;
  text-align: center;
  gap: 6px;
  display: flex;
}

/* Card Roc Chaud */
.roc-chaud {
  background: #1c100a;
  border-color: #3a2010;
  flex-direction: column;
  text-align: center;
  gap: 6px;
  display: flex;
}

/* Nom couleur Roc Froid */
.roc-froid .roc-name { color: #80d8f0; }
/* Nom couleur Roc Chaud */
.roc-chaud .roc-name { color: #f07840; }

.gap-12 { gap: 12px; }
.roc-stat-cold     { color: #60c0f0; font-weight: 600; }
.roc-stat-cold-alt { color: #80d8f0; font-weight: 600; }

/* GIF taille fixe centré (ex: Rocs, mécaniques avec dimensions précises) */
.gif-fixed {
  margin-top: 8px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  justify-content: center;
}
.gif-fixed img {
  width: 299px;
  height: 185px;
  display: block;
  border-radius: 8px;
  object-fit: cover;
}

/* GIFs côte à côte — hauteur fixe identique */
.gif-pair .img-box img {
  height: 220px;
  object-fit: cover;
}

/* ══════════════════════════════════════════════════════════════
   STÈLES D'INTERVENTION — Système data-stele
   Ajouter une nouvelle stèle = ajouter un bloc [data-stele="nom"]
   HTML : <div class="card-intervention" data-stele="aguabrial">
══════════════════════════════════════════════════════════════ */

/* Base commune — utilise les variables locales définies par data-stele */
.card-intervention {
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: visible;
  background:    var(--si-bg);
  border:        1px solid var(--si-border);
  box-shadow:    0 0 12px var(--si-glow), inset 0 0 20px var(--si-inset);
  transition:    box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.card-intervention:hover {
  border-color:  var(--si-hover-border);
  box-shadow:    0 0 6px var(--si-hover-shadow), 0 0 20px var(--si-hover-glow);
  transform:     translateY(-2px);
}
.card-intervention:hover .intervention-img {
  filter: drop-shadow(0 4px 24px rgba(0,0,0,0.9)) drop-shadow(0 0 12px var(--si-drop-shadow));
}
.card-intervention .res-block {
  background:    var(--si-res-bg);
  border-color:  var(--si-res-border);
}
.card-intervention .intervention-gif-card {
  background:    var(--si-res-bg);
  border:        0.5px solid var(--si-res-border);
}
.card-intervention .intervention-gif-label { color: var(--si-label); }
.card-intervention .intervention-gif-name  { color: var(--si-filename); }
.card-intervention .badge-stele-interv {
  background:    var(--si-badge-bg);
  color:         var(--si-badge-color);
  border:        1px solid var(--si-badge-border);
}

/* ── Anathar (doré) ─────────────────────────────────────────── */
.card-intervention[data-stele="anathar"] {
  --si-bg:           #12100a;
  --si-border:       rgba(200,150,40,0.25);
  --si-glow:         rgba(200,150,40,0.1);
  --si-inset:        rgba(160,100,20,0.04);
  --si-hover-border: rgba(220,170,60,0.7);
  --si-hover-shadow: rgba(220,170,60,0.5);
  --si-hover-glow:   rgba(180,120,30,0.3);
  --si-drop-shadow:  rgba(220,170,60,0.5);
  --si-res-bg:       #0e0c06;
  --si-res-border:   rgba(200,150,40,0.2);
  --si-badge-bg:     #1a1206;
  --si-badge-color:  #d4a030;
  --si-badge-border: rgba(200,150,40,0.35);
  --si-label:        #d4a030;
  --si-filename:     #6a7060;
}

/* ── Aguabrial (cyan) ───────────────────────────────────────── */
.card-intervention[data-stele="aguabrial"] {
  --si-bg:           #0a1a1c;
  --si-border:       rgba(26,255,220,0.2);
  --si-glow:         rgba(26,255,220,0.15);
  --si-inset:        rgba(26,200,255,0.04);
  --si-hover-border: rgba(26,255,204,0.7);
  --si-hover-shadow: rgba(26,255,204,0.6);
  --si-hover-glow:   rgba(26,200,255,0.3);
  --si-drop-shadow:  rgba(26,255,204,0.5);
  --si-res-bg:       #060e12;
  --si-res-border:   rgba(26,255,204,0.2);
  --si-badge-bg:     #0a2a2a;
  --si-badge-color:  #1affcc;
  --si-badge-border: rgba(26,255,204,0.3);
  --si-label:        #1affcc;
  --si-filename:     #4a7a9b;
}

/* ── Cire Momore (violet vif) ───────────────────────────────── */
.card-intervention[data-stele="cire-momore"] {
  --si-bg:           #0e0814;
  --si-border:       rgba(144,80,210,0.25);
  --si-glow:         rgba(144,80,210,0.12);
  --si-inset:        rgba(100,40,180,0.04);
  --si-hover-border: rgba(170,100,240,0.7);
  --si-hover-shadow: rgba(170,100,240,0.5);
  --si-hover-glow:   rgba(120,60,200,0.3);
  --si-drop-shadow:  rgba(170,100,240,0.5);
  --si-res-bg:       #08060e;
  --si-res-border:   rgba(144,80,210,0.2);
  --si-badge-bg:     #120a1e;
  --si-badge-color:  #b070e0;
  --si-badge-border: rgba(144,80,210,0.35);
  --si-label:        #b070e0;
  --si-filename:     #6a5080;
  overflow: visible;
  position: relative;
  box-shadow:
    0 0 16px 4px rgba(192,64,208,0.5),
    0 0 40px 8px rgba(220,51,222,0.2),
    inset 0 0 24px rgba(140,40,180,0.06);
  animation: cireGlow 2.8s ease-in-out infinite;
}

@keyframes cireGlow {
  0%,100% {
    box-shadow:
      0 0 14px 3px rgba(192,64,208,0.45),
      0 0 36px 7px rgba(220,51,222,0.18),
      inset 0 0 20px rgba(140,40,180,0.05);
  }
  50% {
    box-shadow:
      0 0 24px 7px rgba(220,51,222,0.75),
      0 0 60px 14px rgba(255,96,255,0.3),
      inset 0 0 32px rgba(180,60,220,0.1);
  }
}

/* ── Cire Momore Ankylosé (violet glacé/désaturé) ───────────── */
.card-intervention[data-stele="cire-momore-ankylse"] {
  --si-bg:           #0c0e16;
  --si-border:       rgba(90,100,160,0.25);
  --si-glow:         rgba(90,100,160,0.12);
  --si-inset:        rgba(60,70,130,0.04);
  --si-hover-border: rgba(110,125,190,0.7);
  --si-hover-shadow: rgba(110,125,190,0.5);
  --si-hover-glow:   rgba(80,90,160,0.3);
  --si-drop-shadow:  rgba(110,125,190,0.5);
  --si-res-bg:       #080a10;
  --si-res-border:   rgba(90,100,160,0.2);
  --si-badge-bg:     #0e1020;
  --si-badge-color:  #8090c0;
  --si-badge-border: rgba(90,100,160,0.35);
  --si-label:        #8090c0;
  --si-filename:     #505870;
}

/* ── Comte Harebourg (bleu-teal) ────────────────────────────── */
/* Couleurs extraites de l'implémentation existante dans usine_Hibourg */
.card-intervention[data-stele="harebourg"] {
  --si-bg:           #06161e;
  --si-border:       rgba(48,160,192,0.25);
  --si-glow:         rgba(48,160,192,0.12);
  --si-inset:        rgba(30,120,160,0.04);
  --si-hover-border: rgba(48,160,192,0.7);
  --si-hover-shadow: rgba(48,160,192,0.5);
  --si-hover-glow:   rgba(30,120,160,0.3);
  --si-drop-shadow:  rgba(48,160,192,0.5);
  --si-res-bg:       #060e12;
  --si-res-border:   rgba(48,160,192,0.25);
  --si-badge-bg:     #06161e;
  --si-badge-color:  #30b0c0;
  --si-badge-border: rgba(48,160,192,0.3);
  --si-label:        #30b0c0;
  --si-filename:     #4a7a9b;
}

/* ── Classes utilitaires supplémentaires ─────────────────────── */

/* Phase bar segments égaux (ex: Dragoeuf — 3 phases égales) */
.ph-equal { flex: 1; }
.ph-equal:first-child { border-radius: 8px 0 0 8px; }
.ph-equal:last-child  { border-radius: 0 8px 8px 0; }

/* Card avec boss centré débordant en haut (phases avec image) */
.card-phase-boss {
  position: relative;
  overflow: visible;
  padding-top: 95px;
}

/* Texte couleur meta (secondaire, labels) */
.text-meta { color: var(--theme-meta); }

/* Grid phases côte à côte sans gap */
.grid-phases {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding-top: 50px;
}

/* Marge top grande (50px) pour les phases */
.mt-50 { margin-top: 50px; }

/* Marge bottom 16px */
.mb-16 { margin-bottom: 1rem; }


/* ══════════════════════════════════════════════════════════════
   RESPONSIVE MOBILE — Media queries pour téléphone
══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  
  /* ── Body : taille de police réduite et padding minimal ──── */
  body {
    font-size: 14px;
    padding: 0.75rem;
    padding-top: 68px !important;
    line-height: 1.6;
  }

  /* ── Container : utilise toute la largeur ──────────────────── */
  .container {
    max-width: 100%;
  }

  /* ── Cards : padding réduit ─────────────────────────────────── */
  .card, .boss-card, .monster-card, .stele-card, .tip-card {
    padding: 0.75rem;
  }

  .card-intervention {
    padding: 0.75rem;
  }

  /* ── Typography : tailles réduites ──────────────────────────── */
  h1 {
    font-size: 24px;
    margin-bottom: 0.5rem;
  }

  h2 {
    font-size: 20px;
    margin: 1.5rem 0 0.5rem;
  }

  .card-text {
    font-size: 14px;
  }

  /* ── Header card : plus compact ─────────────────────────────── */
  .header-card {
    padding: 0.75rem;
  }

  .header-content {
    padding: 0.75rem;
  }

  .header-sub {
    font-size: 13px;
  }

  .header-badges {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  .info-badge {
    font-size: 11px;
    padding: 4px 8px;
  }

  .info-badge img {
    width: 14px;
    height: 14px;
  }

  /* ── Boss layout : image au-dessus, contenu en dessous ────── */
  .boss-layout {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .boss-stats {
    width: 100%;
    padding-top: 90px;
    min-width: unset;
    gap: 8px;
  }

  .boss-content {
    width: 100%;
  }

  .boss-gifs {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    gap: 10px;
  }

  .boss-img-left {
    width: 200px;
    height: 200px;
    top: -100px;
  }

  /* ── Monster cards : plus compactes ─────────────────────────── */
  .monster-card {
    padding: 0.75rem;
    padding-top: 80px;
  }

  .monster-img {
    width: 100px;
    height: 100px;
    top: -35px;
  }

  .monster-img img {
    width: 100px;
    height: 100px;
  }

  .monster-desc {
    font-size: 14px;
  }

  .monster-condition {
    font-size: 11px;
  }

  /* ── Résistances : plus compactes ───────────────────────────── */
  .res-block {
    gap: 6px;
  }

  .res-item {
    font-size: 12px;
    padding: 3px 6px;
  }

  .res-item img {
    width: 12px;
    height: 12px;
  }

  /* ── Badges : plus petits ───────────────────────────────────── */
  .badge {
    font-size: 11px;
    padding: 4px 10px;
  }

  .badge-monster, .badge-section {
    font-size: 12px;
  }

  /* ── Intervention layout : gifs en dessous ──────────────────── */
  .intervention-layout {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .intervention-stats {
    width: 100%;
    min-width: unset;
    padding-top: 120px;
  }

  .intervention-content {
    width: 100%;
  }

  .intervention-gifs {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    gap: 10px;
  }

  .intervention-img {
    width: 200px;
    height: 200px;
    top: -70px;
    left: 50%;
    transform: translateX(-50%);
  }

  /* ── Focus order : wrap sur mobile ──────────────────────────── */
  .focus-order {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .focus-order .arrow {
    display: none;
  }

  .focus-step {
    margin: 6px;
  }

  .focus-num {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  /* ── Tips cards : plus compactes ────────────────────────────── */
  .tip-card {
    padding: 0.75rem;
  }

  .tip-card-title {
    font-size: 14px;
  }

  .tip-card-text {
    font-size: 13px;
  }

  .tip {
    font-size: 13px;
    padding: 8px 10px;
  }

  /* ── Sublimation inline : wrap sur mobile ───────────────────── */
  .sublimation-inline {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .sublimation-inline-icon {
    width: 42px;
    height: 42px;
  }

  .sublimation-inline-text {
    font-size: 16px;
  }

  /* ── Stèle h2 icon : cache sur mobile ───────────────────────── */
  .stele-h2-icon {
    display: none;
  }

  .stele-desc {
    font-size: 14px;
  }

  /* ── Section labels : plus petits ───────────────────────────── */
  .section-label {
    font-size: 13px;
  }

  /* ── Phases : plus compactes ────────────────────────────────── */
  .phase-bar {
    height: 6px;
  }

  .phase-label {
    font-size: 10px;
    gap: 8px;
  }

  /* ── Placeholder : plus compact ─────────────────────────────── */
  .img-placeholder {
    font-size: 11px;
    padding: 0.75rem;
    min-height: 80px;
  }
}
