/* Ajouts au thème Godlike pour Six Elements Dungeon. */

/* Le thème n'a que cinq couleurs d'accent : le Néant et le Neutre ont la leur. */
.text-void {
  color: #8f7bb5 !important;
}
.bg-void {
  background-color: #241d33 !important;
}
.text-neutre {
  color: #c8a951 !important;
}
.bg-neutre {
  background-color: #2b2519 !important;
}

/* Le livret est du Markdown converti : il n'a aucune classe à lui. */
.sed-prose h2 {
  margin-top: 2.5rem;
  font-size: 1.6rem;
}
.sed-prose h3 {
  margin-top: 2rem;
  font-size: 1.25rem;
}
.sed-prose h4 {
  margin-top: 1.5rem;
  font-size: 1.05rem;
}
.sed-prose ul,
.sed-prose ol {
  padding-left: 1.4rem;
}
.sed-prose li {
  margin-bottom: 0.3rem;
}
.sed-prose blockquote {
  padding: 0.6rem 1.2rem;
  border-left: 3px solid #c8a951;
  color: #b9b9b9;
  font-style: italic;
}
.sed-prose table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.sed-prose th,
.sed-prose td {
  padding: 0.5rem 0.75rem;
  border: 1px solid #2d2d2d;
  vertical-align: top;
}
.sed-prose th {
  background-color: #181818;
  color: #c8a951;
  font-weight: 700;
  text-align: left;
}
.sed-prose tr:nth-child(even) td {
  background-color: rgba(255, 255, 255, 0.02);
}
.sed-prose code {
  padding: 0.1rem 0.35rem;
  background-color: #181818;
  border-radius: 2px;
  font-size: 0.88em;
}

/* Un chapitre ne doit pas s'arrêter sous la barre de navigation collante. */
.sed-chapter {
  scroll-margin-top: 110px;
  padding-top: 1px;
}

/* Les infographies du livret : pleine largeur de colonne, cadre doré, et le
   grand format au clic. */
.sed-visual {
  margin: 1.5rem 0 2rem;
}
.sed-visual a {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(200, 169, 81, 0.35);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: border-color 0.2s, transform 0.2s;
}
.sed-visual a:hover {
  border-color: rgba(200, 169, 81, 0.85);
  transform: translateY(-2px);
}
.sed-visual img {
  display: block;
  width: 100%;
  height: auto;
}
.sed-visual figcaption {
  margin-top: 0.6rem;
  color: #b9b9b9;
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
}

/* Les visuels de cartes sont tous en 1024x771 : la grille reste régulière. */
.sed-card img {
  width: 100%;
  aspect-ratio: 1024 / 771;
  object-fit: cover;
}

.sed-element-facts {
  width: 100%;
  margin-top: 1rem;
  font-size: 0.95rem;
}
.sed-element-facts th,
.sed-element-facts td {
  padding: 0.4rem 0.75rem 0.4rem 0;
  border-top: 1px solid #2d2d2d;
  vertical-align: top;
}
.sed-element-facts th {
  width: 8rem;
  color: #c8a951;
  font-weight: 700;
  white-space: nowrap;
}

.sed-element-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.sed-element-emoji {
  font-size: 2.2rem;
  line-height: 1;
}

.sed-element-icon {
  width: 96px;
  height: 96px;
  object-fit: contain;
}
.sed-element-icon-sm {
  width: 64px;
  height: 64px;
}

/* La carte telle que la rend le backoffice sed (public/css/mtg-{monsters,skills}.css),
   préfixée : Bootstrap possède déjà .card-title, .card-text et .bar. */
.sed-card-modal .modal-content {
  align-items: center;
  background: transparent;
  border: 0;
}
/* Fixe dans le coin de l'écran : la carte est centrée et ne doit jamais le recouvrir. */
.sed-card-modal .close {
  position: fixed;
  top: 0.5rem;
  right: 1.5rem;
  z-index: 10;
  color: #f0d080;
  font-size: 3rem;
  font-weight: 400;
  opacity: 1;
  text-shadow: 0 1px 4px #000;
}
.sed-card-modal .close:hover {
  color: #f0d080;
  opacity: 1;
}
@media (min-width: 768px) {
  .sed-card-modal .sed-mtg-card {
    zoom: 1.4;
  }
}

.sed-mtg-card {
  position: relative;
  width: 440px;
  height: 315px;
  overflow: hidden;
  background: #0a0a0a;
  border: 3px solid var(--sed-element, #7a5c1e);
  border-radius: 12px;
  box-shadow: 0 0 0 1px #000, 0 0 20px rgba(0, 0, 0, 0.8);
  font-family: Georgia, serif;
}
.sed-mtg-card.feu {
  --sed-element: #ff4010;
}
.sed-mtg-card.eau {
  --sed-element: #2090e0;
}
.sed-mtg-card.terre {
  --sed-element: #50a030;
}
.sed-mtg-card.air {
  --sed-element: #e0c020;
}
.sed-mtg-card.poison {
  --sed-element: #9050c8;
}
.sed-mtg-card.neant {
  --sed-element: #222222;
}
.sed-mtg-card.neutre {
  --sed-element: #909090;
}

.sed-mtg-art {
  position: absolute;
  inset: 0;
}
.sed-mtg-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sed-mtg-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.1) 30%,
    rgba(0, 0, 0, 0.5) 60%,
    rgba(0, 0, 0, 0.9) 100%
  );
}

.sed-mtg-top {
  position: absolute;
  top: 6px;
  right: 14px;
  left: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sed-mtg-title {
  max-width: 340px;
  overflow: hidden;
  color: #f0d080;
  font-family: "Marcellus SC", serif;
  font-size: 24px;
  letter-spacing: 1px;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px #000, 0 0 10px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}
.sed-mtg-orb {
  width: 42px;
  height: 42px;
  object-fit: contain;
}
/* Les Objets n'ont pas d'élément : une amphore tient la place du médaillon. */
.sed-mtg-orb-text {
  font-size: 30px;
  line-height: 42px;
  text-align: center;
}

.sed-mtg-content {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 60px 14px 14px;
}
.sed-mtg-powers {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  overflow: hidden;
}
.sed-mtg-power {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-left: 3px solid;
  border-radius: 4px;
  font-size: 18px;
  line-height: 1.2;
}
.sed-mtg-power.attack {
  border-color: #c04040;
  background: linear-gradient(90deg, rgba(180, 50, 50, 0.25) 0%, rgba(0, 0, 0, 0.4) 100%);
  color: #f0c0b0;
}
.sed-mtg-power.defense {
  border-color: #4080c0;
  background: linear-gradient(90deg, rgba(50, 80, 180, 0.25) 0%, rgba(0, 0, 0, 0.4) 100%);
  color: #b0d0f0;
}
.sed-mtg-power.object {
  border-color: #40a050;
  background: linear-gradient(90deg, rgba(50, 160, 80, 0.25) 0%, rgba(0, 0, 0, 0.4) 100%);
  color: #a0e0b0;
}
.sed-mtg-power-icon {
  flex: 0 0 16px;
}

/* Une Aventure n'a pas de pouvoirs mais trois paliers, chacun avec ses deux issues. */
.sed-mtg-level {
  display: grid;
  grid-template-columns: 8.5rem 1fr 1fr;
  gap: 8px;
  padding: 5px 10px;
  border-left: 3px solid rgba(201, 168, 76, 0.6);
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(201, 168, 76, 0.15) 0%, rgba(0, 0, 0, 0.4) 100%);
  font-size: 11px;
  line-height: 1.3;
}
.sed-mtg-level-goal {
  color: #f0d080;
  font-family: "Marcellus SC", serif;
}
.sed-mtg-level-failure {
  color: #f08080;
}
.sed-mtg-level-success {
  color: #80f0a0;
}

.sed-mtg-bottom {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(201, 168, 76, 0.2);
}
.sed-mtg-flavor {
  display: -webkit-box;
  flex: 1;
  overflow: hidden;
  color: #b0a080;
  font-size: 15px;
  font-style: italic;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.sed-mtg-stats {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
}
.sed-mtg-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 3px;
  font-size: 15px;
}
.sed-mtg-badge-value {
  font-family: "Marcellus SC", serif;
}
.sed-mtg-badge.dice .sed-mtg-badge-value {
  color: #f08080;
}
.sed-mtg-badge.mana .sed-mtg-badge-value {
  color: #a0c8f8;
}
.sed-mtg-badge.atk .sed-mtg-badge-value {
  color: #f08080;
}
.sed-mtg-badge.def .sed-mtg-badge-value {
  color: #80b0f0;
}
.sed-mtg-badge.mag .sed-mtg-badge-value {
  color: #c0a0f0;
}
.sed-mtg-badge.hp .sed-mtg-badge-value {
  color: #f0c080;
}
/* Les prérequis d'un équipement se lisent sous les pouvoirs, en retrait. */
.sed-mtg-badge.req {
  border-style: dashed;
  font-size: 12px;
}
.sed-mtg-badge.req .sed-mtg-badge-value {
  color: #c9a84c;
}
.sed-mtg-rarity {
  position: absolute;
  right: 18px;
  bottom: 4px;
  z-index: 10;
  font-size: 7px;
  line-height: 1;
}

@media (max-width: 640px) {
  .sed-mtg-card {
    width: 340px;
    height: 200px;
  }
  .sed-mtg-content {
    padding: 34px 10px 10px;
  }
  .sed-mtg-title {
    max-width: 200px;
    font-size: 16px;
  }
  .sed-mtg-orb {
    width: 30px;
    height: 30px;
  }
  .sed-mtg-power {
    padding: 4px 8px;
    font-size: 13px;
  }
  .sed-mtg-flavor,
  .sed-mtg-badge {
    font-size: 12px;
  }
  .sed-mtg-level {
    grid-template-columns: 6rem 1fr 1fr;
    gap: 4px;
    font-size: 9px;
  }
}

/* Formulaire de contact. Le thème habille déjà .form-control : il ne reste que
   l'étiquette, la ligne d'erreur et le champ leurre anti-robot. */
.sed-form .form-group {
  margin-bottom: 1.4rem;
}

.sed-form label {
  display: block;
  margin-bottom: 0.2rem;
  font-family: "Marcellus SC", serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sed-form textarea.form-control {
  resize: vertical;
}

.sed-form-error {
  display: block;
  margin-top: 0.3rem;
  color: #e0584a;
}

.sed-form-decoy {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* Les en-têtes de page. Sans la parallaxe, l'image se recadre au CSS : calée
   vers le haut, elle ne perd plus le sommet de l'illustration. Son bas se
   dissout dans le fond de page — le cadre du thème habille déjà les trois
   autres côtés, un bord franc en bas jurerait. */
.sed-header-fade {
  background-color: transparent;
}

.sed-header-fade .bg-image {
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}

/* Le décalage de 100px demande 100px de rab : sur un écran étroit le cadrage
   `cover` colle déjà aux deux bords, et décaler l'image n'ouvrirait qu'une
   bande vide au-dessus du contenu. L'image se dessine donc dans une boîte plus
   haute que l'en-tête, dont le bas est rogné par `overflow: hidden`. */
.sed-header-fade .bg-image img {
  height: calc(100% + 100px);
  object-position: 50% -100px;
}
