
/* =======================================================
   Mystic VirtualPlay — Wiki Docsify Style (v3.2.0)
   ======================================================= */

@import url('https://fonts.googleapis.com/css2?family=Marcellus+SC&family=Inter:wght@400;500;600&display=swap');

/* Anti-débordement global : évite que padding/border ajoutent
   de la largeur en plus des width déclarées (cause fréquente
   de débordement horizontal sur mobile) */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Sécurité anti-débordement pour médias (images/iframes/vidéos)
   quelle que soit la taille d'écran */
img, iframe, video, embed, object {
  max-width: 100%;
}

:root {
  --bg0: #030813;
  --bg1: #050b16;
  --glass: #ffffff10;
  --stroke: #89dcff44;
  --accent: #89dcff;
  --text: #e9f3ff;
  --muted: #a8b3c7;
  --glow: rgba(137, 220, 255, 0.35);
  --ease: cubic-bezier(.2,.8,.2,1);
}
/* =======================================================
   ✦ Base du thème Mystic ✦
   ======================================================= */

html, body {
  margin: 0;
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background-color: var(--bg0);
  background-image:
    url("https://mystic-virtualplay.fr/dev/images/background8.png"),
    radial-gradient(
      80% 120% at 50% -10%,
      rgba(10,28,50,0.8) 0%,
      rgba(5,11,22,0.7) 40%,
      rgba(3,8,19,0.9) 100%
    );
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  /* SUPPRIMER → overflow-x: hidden; */
}
/* =======================================================
   ✦ Blobs lumineux ✦
   ======================================================= */

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
  animation: blobMove 25s infinite alternate ease-in-out;
}

body::before {
  width: 600px;
  height: 600px;
  left: 15%;
  top: 25%;
  background: #89dcff22;
}

body::after {
  width: 500px;
  height: 500px;
  right: 10%;
  bottom: 20%;
  background: #1fb6ff22;
}

@keyframes blobMove {
  from { transform: translateY(0px) translateX(0px); }
  to { transform: translateY(50px) translateX(-30px); }
}
/* =======================================================
   ✦ Structure principale ✦
   ======================================================= */

main {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  min-width: 0;
}

/* ===== Sidebar ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 325px;
  min-width: 325px;
  padding-top: 74px;
  box-sizing: border-box;
  background: rgba(5, 14, 25, 0.95);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--stroke);
  box-shadow: inset 0 0 30px rgba(137,220,255,.15);
  overflow-y: auto;
  transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
  z-index: 1000;
}
.sidebar.closed {
  transform: translateX(-100%);
  opacity: 0;
}

/* ===== Bouton toggle ===== */
.toggle-btn {
  position: fixed;
  top: 18px;
  left: calc(15vw - 6px);
  width: 42px;
  height: 42px;
  background: #0a1626;
  border: 1px solid rgba(137,220,255,0.5);
  border-radius: 50%;
  color: #aee4ff;
  font-size: 20px;
  cursor: pointer;
  z-index: 1200;
  box-shadow: 0 4px 18px rgba(0,0,0,0.55), 0 0 12px rgba(137,220,255,0.3);
  transition: left 0.5s cubic-bezier(.2,.8,.2,1), transform 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

/* 🔹 Quand la sidebar est fermée */
.sidebar.closed ~ .toggle-btn {
  left: 20px;
}
.toggle-btn:hover {
  box-shadow: 0 0 20px rgba(137,220,255,0.5), inset 0 0 25px rgba(137,220,255,0.3);
  transform: scale(1.1);
  color: #dff9ff;
}

/* =======================================================
   ✦ Contenu principal ✦
   ======================================================= */

.content {
  flex: 1;
  min-width: 0;
  margin-left: calc(15vw + 18px);
  padding: 40px;
  transition: margin-left 0.4s var(--ease);
}
.sidebar.closed ~ .content {
  margin-left: 0;
}

/* ===== Bloc interne ===== */
.markdown-section {
  background: rgba(5, 14, 25, 0.55);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  box-shadow: inset 0 0 40px rgba(137,220,255,0.08),
              0 0 25px rgba(137,220,255,0.12);
  padding: 40px 60px;
  margin: 40px;
  color: var(--muted);
  line-height: 1.6;
  border: 1px solid rgba(137,220,255,0.15);
}

.markdown-section h1,
.markdown-section h2,
.markdown-section h3 {
  font-family: 'Marcellus SC', serif;
  color: var(--accent);
  text-shadow: 0 0 12px var(--glow);
}

.markdown-section p {
  font-size: 1.05rem;
  max-width: 900px;
}

/* ===== Images ===== */
.markdown-section img {
  max-width: 100%;
  border-radius: 16px;
  box-shadow: 0 0 25px rgba(137,220,255,0.25);
  display: block;
  margin: 30px auto;
}

/* =======================================================
   🔮 Mystic Sidebar - Accordéon & Animations
   ======================================================= */

/* Colle le menu au bord gauche de la sidebar (annule l'indentation par défaut du <ul>) */
.sidebar-nav > ul {
  list-style: none;
  margin: 0;
  padding-left: 4px;
}

/* =======================================================
   ⬅ Bouton Retour (texte, plus d'image)
   ======================================================= */

.mystic-back-wrap {
  margin: 50px 0 20px min(10%, 80px);
}

.mystic-back-btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 30px;
  border: 1px solid rgba(137,220,255,0.4);
  background: rgba(8,20,35,0.85);
  color: #aee4ff;
  font-family: 'Marcellus SC', serif;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: all 0.2s ease;
}

.mystic-back-btn:hover {
  background: rgba(137,220,255,0.15);
  border-color: rgba(137,220,255,0.7);
  box-shadow: 0 0 14px rgba(137,220,255,0.3);
  color: #dff9ff;
}

/* =======================================================
   🔍 Recherche globale du wiki (barre en haut du contenu)
   ======================================================= */

.wiki-topsearch-wrap {
  position: relative;
  max-width: 700px;
  margin: 0 min(10%, 80px) 24px;
}

.wiki-topsearch-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(8,15,38,0.75);
  border: 1px solid rgba(137,220,255,0.35);
  border-radius: 30px;
  padding: 16px 50px 16px 50px;
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  color: #e9f3ff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.wiki-topsearch-input::placeholder { color: rgba(137,220,255,0.45); }

.wiki-topsearch-input:focus {
  border-color: rgba(137,220,255,0.75);
  box-shadow: 0 0 22px rgba(137,220,255,0.3);
}

.wiki-topsearch-icon {
  position: absolute;
  left: 18px;
  top: 16px;
  font-size: 1.2rem;
  color: rgba(137,220,255,0.55);
  pointer-events: none;
}

.wiki-topsearch-clear {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(137,220,255,0.12);
  color: #aee4ff;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}
.wiki-topsearch-clear:hover { background: rgba(137,220,255,0.25); }

.wiki-topsearch-results {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 60vh;
  overflow-y: auto;
  background: #0a1626;
  border: 1px solid rgba(137,220,255,0.35);
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.55);
  z-index: 1300;
}
.wiki-topsearch-results.open { display: block; }

.wiki-topsearch-item {
  display: block;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(137,220,255,0.1);
  text-decoration: none;
  color: inherit;
}
.wiki-topsearch-item:last-child { border-bottom: none; }
.wiki-topsearch-item:hover { background: rgba(137,220,255,0.1); }

/* Titre = seule info mise en avant */
.wiki-topsearch-item-title {
  display: block;
  color: #89dcff;
  font-weight: 600;
  font-size: 1rem;
}

/* Description en très petite police, discrète */
.wiki-topsearch-item-desc {
  display: block;
  color: rgba(200,220,255,0.5);
  font-size: 0.68rem;
  line-height: 1.4;
  margin-top: 2px;
}

.wiki-topsearch-item-title mark {
  background: rgba(137,220,255,0.35);
  color: #fff;
  border-radius: 3px;
  padding: 0 2px;
}

.wiki-topsearch-empty {
  padding: 16px;
  text-align: center;
  color: rgba(200,220,255,0.5);
  font-size: 0.85rem;
}

.sidebar-nav li.open > ul {
  max-height: 1000px;
  
  opacity: 1;
}

/* Titres & hover */
.sidebar-nav > ul > li,
.sidebar-nav > ul > li > em {
  cursor: pointer;
  display: block;
  padding: 0px 14px;
  color: #89dcff;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s var(--ease);
}
.sidebar-nav > ul > li > strong:hover,
.sidebar-nav > ul > li > em:hover {
  background: rgba(137,220,255,0.08);
  box-shadow: inset 0 0 15px rgba(137,220,255,0.15);
  text-shadow: 0 0 10px rgba(137,220,255,0.6);
}

/* Flèches */
.sidebar-nav > ul > li > strong::after,
.sidebar-nav > ul > li > em::after {
  content: "▸";
  position: absolute;
  right: 10px;
  top: 8px;
  font-size: 0.9rem;
  opacity: 0.6;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.sidebar-nav li.open > strong::after,
.sidebar-nav li.open > em::after {
  transform: rotate(90deg);
  opacity: 1;
  color: #dff9ff;
}

/* Liens */
.sidebar-nav a {
  display: block;
  padding: 8px 16px;
  margin: 3px 0;
  border-radius: 6px;
  color: #a6c9ff;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}
.sidebar-nav a:hover {
  background: rgba(70, 100, 200, 0.25);
  color: #e8f1ff;
  text-shadow: 0 0 8px #8fc9ff;
  box-shadow: inset 0 0 10px rgba(120,160,255,0.3);
}
/* Ouvre tous les menus par défaut */
.sidebar-nav ul ul {
  max-height: 1000px !important;
  opacity: 1 !important;
}

.sidebar-nav li {
  /* force l'état ouvert */
  & > ul {
    display: block !important;
  }
  &.open > ul {
    max-height: 1000px !important;
  }
}
/* Tableaux PNJ — version compacte */
.mystic-table-wrapper.narrow {
  max-width: 750px;       /* largeur réduite */
  margin: 0 auto;         /* centré */
}

.mystic-table-left td,
.mystic-table-left th {
  text-align: left !important;   /* tout à gauche */
  vertical-align: top;           /* alignement propre */
}



/* =======================================================
   ✦ Mystic VirtualPlay — HR Cristal Magique ✦
   ======================================================= */

.markdown-section hr,
.sidebar hr,
.content hr,
hr {
  border: none !important; /* ❌ annule le border par défaut */
  height: 3px !important;
  width: 80% !important;
  margin: 35px auto !important;
  background: linear-gradient(90deg, transparent, #89dcff, transparent) !important;
  box-shadow: 0 0 15px #89dcff88, 0 0 25px #89dcff55;
  border-radius: 4px;
  opacity: 0.9;
  transition: all 0.6s ease;
}

/* ✨ Animation “respiration magique” */
@keyframes hrGlow {
  0%   { box-shadow: 0 0 8px #89dcff66, 0 0 18px #89dcff33; opacity: 0.7; }
  50%  { box-shadow: 0 0 20px #89dcffcc, 0 0 40px #89dcffaa; opacity: 1; }
  100% { box-shadow: 0 0 8px #89dcff66, 0 0 18px #89dcff33; opacity: 0.7; }
}

/* 🌌 Appliquer l’animation */
.markdown-section hr,
.sidebar hr {
  animation: hrGlow 5s ease-in-out infinite;
}


/* =======================================================
   ✦ Scrollbar Mystique ✦
   ======================================================= */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(3, 8, 19, 0.6); /* fond sombre discret */
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #89dcff55, #1fb6ff55);
  border-radius: 10px;
  box-shadow: 0 0 6px #89dcff66;
  transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #89dcff, #1fb6ff);
  box-shadow: 0 0 10px #89dcffcc;
}

::-webkit-scrollbar-corner {
  background: transparent;
}


/* =========================================================
   📦 Cards plus larges, centrées et 100% responsive
   ========================================================= */

.card {
  max-width: 1500px;   /* largeur max sur desktop */
  width: 100%;        /* prend toute la largeur possible */
  margin: 0 auto;     /* centrée horizontalement */
}

/* 📱 Version mobile : occupe toute la largeur sans débordement */
@media (max-width: 1500px) {
  .card {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  grid-column: 1 / -1;
  }
}
/* ============================================
   ✨ Police adaptée pour les paragraphes
   ============================================ */

/* Paragraphes, listes, italique */

em,
ol {
  font-family: 'Marcellus SC', serif !important;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.75;      /* Lisibilité ++ */
  letter-spacing: 0.01em; /* léger espacement */
  color: #e8f1ff;         /* blanc doux */
  margin-bottom: 14px;
}

/* Titre mystiques uniquement */
h1, h2, h3, h4 {
  font-family: 'Marcellus SC', serif !important;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.03em;
}

/* ================================================
   TABLEAUX GLASS MYSTIC — FORCE PRIORITÉ THEME DOCSIFY
   ================================================ */
/* === REPAIR DOCSIFY TABLE BREAK === */
.markdown-section table {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
}

.markdown-section table tr {
    display: table-row !important;
}

.markdown-section table th,
.markdown-section table td {
    display: table-cell !important;
    padding: inherit !important;
}
/* STOP priorité docsify : on override tout */
.markdown-section .mystic-table-wrapper table.mystic-table {
  all: initial !important;            /* on réinitialise entièrement */
  font-family: inherit !important;    /* on remet une base propre */
  display: table !important;          /* sinon Docsify le casse */
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;

  background: rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(14px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(160%) !important;

  border-radius: 16px !important;
  overflow: hidden !important;
  border: 1px solid rgba(137, 220, 255, 0.25) !important;
  box-shadow: 0 0 22px rgba(137, 220, 255, 0.18) !important;
}

/* === HEADER === */
/* Ciblage sans exiger <thead> : plusieurs pages ont des <th> directement dans <table>
   sans wrapper <thead>, ce qui les laissait sans style (texte noir illisible). */
.markdown-section .mystic-table-wrapper table.mystic-table thead th,
.markdown-section .mystic-table-wrapper table.mystic-table th {
  all: unset !important;
  display: table-cell !important;
  padding: 14px 16px !important;
  background: rgba(137, 220, 255, 0.12) !important;
  border-bottom: 1px solid rgba(137, 220, 255, 0.25) !important;
  color: #e9f7ff !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  text-align: center !important;
}

/* === CELLULES === */
.markdown-section .mystic-table-wrapper table.mystic-table td {
  all: unset !important;
  display: table-cell !important;
  padding: 14px 16px !important;
  color: #e9efff !important;
  font-size: 15px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
  text-align: center !important;
}

/* === LIGNES === */
.markdown-section .mystic-table-wrapper table.mystic-table tbody tr {
  all: unset !important;
  display: table-row !important;
  background: rgba(255, 255, 255, 0.015) !important;
  transition: background 0.2s ease !important;
}

.markdown-section .mystic-table-wrapper table.mystic-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025) !important;
}

.markdown-section .mystic-table-wrapper table.mystic-table tbody tr:hover {
  background: rgba(137, 220, 255, 0.10) !important;
}

/* === SÉPARATION COLONNES === */
.markdown-section .mystic-table-wrapper table.mystic-table td + td,
.markdown-section .mystic-table-wrapper table.mystic-table th + th {
  border-left: 1px solid rgba(255, 255, 255, 0.06) !important;
}


/* === FORCE LE STYLE CARD SUR LES BLOCKQUOTE === */

.markdown-section blockquote.card {
  all: unset !important;          /* annule TOUT le style Docsify */
  display: block !important;
}

.markdown-section blockquote.card {
  padding: 24px !important;
  border-radius: 18px !important;
  background: #0b162acc !important;
  border: 1px solid rgba(137,220,255,0.35) !important;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  margin: 20px auto !important;
  width: 100% !important;
  max-width: 900px !important;
  box-sizing: border-box !important;
}

/* Pour les paragraphes dedans */
.markdown-section blockquote.card p {
  margin: 0 !important;
  color: #e9f7ff !important;
}
   📱 Responsive Mystic — Sidebar & Contenu
   ======================================================= */

@media (max-width: 900px) {

  /* Sidebar prend toute la hauteur mais une largeur fixe */
  .sidebar {
    width: 260px !important;
    transform: translateX(-100%) !important; /* cachée par défaut */
    min-width: 260px !important;
  }

  /* Quand la sidebar est ouverte */
  .sidebar.open {
    transform: translateX(0) !important;
  }

  /* Le contenu doit occuper toute la largeur */
  .content {
    margin-left: 0 !important;
    padding: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Bouton placé toujours au même endroit */
  .toggle-btn {
    left: 20px !important;
    top: 20px;
    z-index: 2000;
  }

  /* Quand la sidebar s’ouvre → bouton collé au bord droit du menu */
  .sidebar.open ~ .toggle-btn {
    left: 250px !important;
  }

  /* Les gros blocs internes */
  .markdown-section {
    margin: 8px 0 !important;
    padding: 10px 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .markdown-section p {
    max-width: 100% !important;
  }

  /* Les cards ne doivent pas ajouter trop de marge sur mobile */
  .markdown-section blockquote.card {
    padding: 10px !important;
    margin: 10px auto !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Réduit les grosses marges latérales sur mobile */
  .mystic-back-wrap {
    margin: 12px 4px 10px !important;
  }

  .wiki-topsearch-wrap {
    max-width: 100% !important;
    margin: 0 4px 14px !important;
  }

  /* Les vidéos Youtube doivent être responsives */
  iframe {
    width: 100% !important;
    height: 220px !important;
  }

  /* Images */
  .markdown-section img {
    max-width: 100% !important;
    height: auto !important;
  }
}


/* === Boutons Okami / Uneri / Seiiki === */
.btn-world {
    width: 260px !important;   /* ← change la taille ici */
    height: auto !important;
    display: inline-block !important;
    margin: 10px auto !important;
    transition: transform 0.25s ease, filter 0.25s ease !important;
}

.btn-world:hover {
    transform: scale(1.07) !important;
    filter: brightness(1.15) !important;
}

/* ============================================
   ✦ Bouton "remonter en haut" Mystic ✦
   ============================================ */

#scrollTopBtn {
  position: fixed;
  bottom: 40px;
  right: 90px;
  width: 50px;
  height: 50px;
  background: rgba(8,20,35,0.85);
  border: 1px solid rgba(137,220,255,0.45);
  border-radius: 50%;
  color: #aee4ff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  box-shadow: 
      0 0 12px rgba(137,220,255,0.25),
      inset 0 0 15px rgba(137,220,255,0.15);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s ease, visibility .4s ease, transform .25s ease;
  z-index: 1500;
}

/* Apparition quand on scroll */
#scrollTopBtn.show {
  opacity: 1;
  visibility: visible;
}

/* Effet hover */
#scrollTopBtn:hover {
  transform: scale(1.12);
  box-shadow:
    0 0 20px rgba(137,220,255,0.6),
    inset 0 0 25px rgba(137,220,255,0.35);
  color: #dff9ff;
}

/* =======================================================
   🔒 CORRECTIF FINAL MOBILE — priorité maximale
   (placé en toute fin de fichier + sélecteurs renforcés
   pour être sûr de gagner sur toute autre règle)
   ======================================================= */
@media screen and (max-width: 900px) {

  html body main .sidebar {
    position: fixed !important;
    transform: translateX(-100%) !important;
    left: 0 !important;
  }

  html body main .sidebar.open {
    transform: translateX(0) !important;
  }

  html body main .content,
  html body main .sidebar.closed ~ .content,
  html body main .sidebar.open ~ .content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding: 6px !important;
    box-sizing: border-box !important;
  }

  html body main .markdown-section {
    width: 100% !important;
    max-width: 100% !important;
    margin: 8px 0 !important;
    padding: 10px 8px !important;
    box-sizing: border-box !important;
  }

  html body {
    overflow-x: hidden !important;
  }

  /* Tableaux : largeur de colonnes forcée pour éviter tout débordement,
     texte qui casse la ligne au besoin */
  .markdown-section table,
  .markdown-section .mystic-table-wrapper table.mystic-table {
    table-layout: fixed !important;
    width: 100% !important;
  }

  .markdown-section table td,
  .markdown-section table th,
  .markdown-section .mystic-table-wrapper table.mystic-table td,
  .markdown-section .mystic-table-wrapper table.mystic-table th {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
  }

  .mystic-table-wrapper.narrow {
    max-width: 100% !important;
  }

  .mystic-table-wrapper {
    overflow-x: auto !important;
    max-width: 100% !important;
  }

  /* Vidéos/images : jamais plus large que l'écran */
  .markdown-section img,
  .markdown-section video {
    max-width: 100% !important;
    height: auto !important;
  }

  .markdown-section iframe {
    max-width: 100% !important;
  }
}

html {
  overflow-x: hidden;
}
