/* Menu lateral commun a toutes les pages (composant .nf-sidebar du fil d'actualite).
   - le logo vit dans le menu, plus dans la topbar ;
   - le menu monte jusqu'en haut de l'ecran, la topbar demarre a sa droite. */
body.site-shell {
  --nf-sidebar-width: 235px;
  --nf-bg: #0b0f1c;
  --nf-surface: #101624;
  --nf-text: #f3f2fd;
  --nf-muted: #a4b0d3;
  --nf-purple: #7651ff;
}

@media (min-width: 1051px) {
  html body.site-shell .nf-sidebar {
    top: 0 !important;
    bottom: 0;
    height: 100vh;
    z-index: 10002;
    padding-top: 10px;
    overflow-y: auto;
  }

  /* topbar decoupee : elle commence a droite du menu, sans logo */
  html body.site-shell .header {
    left: var(--nf-sidebar-width) !important;
    width: calc(100% - var(--nf-sidebar-width)) !important;
    justify-content: flex-end !important;
  }
  html body.site-shell .header .header-brand,
  html body.site-shell .header .hdr-desktop-brand-logo,
  html body.site-shell .header .header-actions-center {
    display: none !important;
  }
  html body.site-shell .header > .header-actions:first-child {
    display: none !important;
  }

  /* ancien menu (rail de 80px + panneau) remplace par le nouveau */
  html body.site-shell #navigation-widget,
  html body.site-shell #navigation-widget-small,
  html body.site-shell .navigation-widget-trigger,
  html body.site-shell .sidemenu-trigger {
    display: none !important;
  }

  /* pages hors fil : on pousse tout le contenu a droite du menu */
  html body.site-shell:not(.newsfeed-reference-page) {
    padding-left: var(--nf-sidebar-width) !important;
  }
}

@media (min-width: 1051px) and (max-width: 1250px) {
  body.site-shell { --nf-sidebar-width: 210px; }
}

/* ecrans etroits : on garde la navigation mobile d'origine */
@media (max-width: 1050px) {
  html body.site-shell:not(.newsfeed-reference-page) .nf-sidebar { display: none !important; }
}

/* Rendu identique au fil d'actualite (ces regles etaient limitees a body.newsfeed-reference-page) */
body.site-shell .nf-sidebar :is(p, a, span, button, input, select, h2, h3, label, strong, small) { font-family: 'Segoe UI', sans-serif; }
body.site-shell .nf-nav-link { font-size: 14px; font-weight: 500; }
body.site-shell .nf-nav .nf-icon { fill: currentColor; }
body.site-shell .nf-nav-unavailable { background: none; text-align: left; width: 100%; cursor: not-allowed; }

/* Le script js/sidebar/sidebar.js decale .content-grid avec un transform calcule
   pour l'ancien rail de 80px. Avec le menu lateral fixe, le contenu est deja
   pousse par le padding du body : on neutralise ce decalage. */
@media (min-width: 1051px) {
  html body.site-shell:not(.newsfeed-reference-page) .content-grid {
    transform: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* ================================================================
   Wiki : mise en forme commune (toutes les pages du wiki)
   ================================================================ */
@media (min-width: 1051px) {
  html body.site-shell:not(.newsfeed-reference-page) { padding-right: 28px !important; padding-left: calc(var(--nf-sidebar-width) + 28px) !important; }
}
body.site-shell.wiki-page .content-grid.wiki-shell { padding-top: 26px !important; }
body.site-shell.wiki-page:not(.wiki-home-page) .content-grid.wiki-shell { max-width: 1240px; }

/* fil d'Ariane + langues sur une meme ligne */
body.wiki-page .wiki-breadcrumbs { min-height: 34px; display: flex; align-items: center; }
body.wiki-page .wiki-language-bar { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin: -40px 0 14px auto; padding: 0; width: max-content; background: none !important; border: 0 !important; box-shadow: none !important; }
body.wiki-page .wiki-language-bar > :not(a):not(div):not(ul) { display: none; }

/* hero illustre et anime */
body.wiki-page .wiki-hero { --wk: #7c5cff; --wk-icon: none; position: relative; isolation: isolate; overflow: hidden; min-height: 230px; padding: 40px 260px 40px 44px; border-radius: 24px;
  border: 1px solid color-mix(in srgb, var(--wk) 35%, transparent);
  background: radial-gradient(420px 260px at 88% 50%, color-mix(in srgb, var(--wk) 30%, transparent), transparent 70%), radial-gradient(520px 300px at 0% 120%, rgba(119,80,248,.28), transparent 70%), linear-gradient(120deg, #151033, #0e1328 60%, #0c1020);
  box-shadow: 0 22px 50px rgba(0,0,0,.35); }
body.wiki-page .wiki-hero::before { content: ''; position: absolute; inset: -40%; z-index: -1; opacity: .35; pointer-events: none;
  background: conic-gradient(from 0deg at 75% 50%, transparent 0deg, color-mix(in srgb, var(--wk) 45%, transparent) 40deg, transparent 90deg, rgba(119,80,248,.35) 200deg, transparent 260deg);
  filter: blur(40px); animation: wk-aurora 14s linear infinite; }
@keyframes wk-aurora { to { transform: rotate(360deg); } }
body.wiki-page .wiki-hero::after { content: ''; position: absolute; right: 56px; top: 50%; width: 150px; height: 150px; margin-top: -75px; border-radius: 34px; border: 1px solid color-mix(in srgb, var(--wk) 55%, transparent);
  background: var(--wk-icon) center / 56% no-repeat, radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--wk) 70%, #fff 0%), color-mix(in srgb, var(--wk) 35%, #0b0f20) 70%);
  box-shadow: 0 0 0 14px color-mix(in srgb, var(--wk) 10%, transparent), 0 0 0 30px color-mix(in srgb, var(--wk) 5%, transparent), 0 18px 40px rgba(0,0,0,.45), 0 0 60px color-mix(in srgb, var(--wk) 45%, transparent);
  transform: rotate(-6deg); animation: wk-float 6s ease-in-out infinite; }
@keyframes wk-float { 0%,100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(4deg) translateY(-10px); } }
body.wiki-page .wiki-hero .wiki-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--wk) 16%, transparent); border: 1px solid color-mix(in srgb, var(--wk) 40%, transparent); color: #fff; }
body.wiki-page .wiki-hero .wiki-kicker::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--wk); box-shadow: 0 0 10px var(--wk); }
body.wiki-page .wiki-hero .wiki-title { margin-top: 14px; text-shadow: 0 6px 24px rgba(0,0,0,.4); }
body.wiki-page .wiki-hero .wiki-lead { max-width: 640px; color: rgba(226,232,240,.85); }

/* navigation entre guides, encadres, sections */
body.wiki-page .wiki-guide-nav a, body.wiki-page .wiki-guide-nav > * { transition: transform .2s, border-color .2s, box-shadow .2s; }
body.wiki-page .wiki-guide-nav a:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--wk, #7c5cff) 60%, transparent); box-shadow: 0 10px 24px rgba(0,0,0,.3); }
body.wiki-page .wiki-note, body.wiki-page .wiki-callout, body.wiki-page .wiki-warning { border-radius: 16px; }
body.wiki-page .wiki-section { margin-top: 42px; }
body.wiki-page .wiki-section > h2, body.wiki-page .wiki-section-head h2 { position: relative; padding-left: 16px; }
body.wiki-page .wiki-section > h2::before, body.wiki-page .wiki-section-head h2::before { content: ''; position: absolute; left: 0; top: 12%; bottom: 12%; width: 5px; border-radius: 4px; background: linear-gradient(180deg, #7c5cff, #4ff461); }

/* cartes et tableaux */
body.wiki-page :is(.wiki-card, .wiki-stat-card, .wiki-tier-card, .wiki-rebirth-card, .wiki-requirement-card, .wiki-family-card, .wiki-taxonomy-card, .wiki-source-card) { border-radius: 16px; transition: transform .2s, border-color .2s, box-shadow .2s; }
body.wiki-page :is(.wiki-card, .wiki-tier-card, .wiki-rebirth-card, .wiki-family-card, .wiki-taxonomy-card):hover { transform: translateY(-3px); border-color: rgba(124,92,255,.5); box-shadow: 0 14px 30px rgba(0,0,0,.35); }
body.wiki-page .wiki-table-wrap { border-radius: 16px; overflow: auto; border: 1px solid rgba(255,255,255,.08); }
body.wiki-page .wiki-table thead th { position: sticky; top: 0; z-index: 1; text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; }
body.wiki-page .wiki-table tbody tr:nth-child(even) td { background: rgba(255,255,255,.018); }
body.wiki-page .wiki-table tbody tr:hover td { background: rgba(124,92,255,.08); color: #fff; }

@media (max-width: 900px) {
  body.wiki-page .wiki-hero { padding: 26px 22px; min-height: 0; }
  body.wiki-page .wiki-hero::after { display: none; }
  body.wiki-page .wiki-language-bar { margin: 0 0 12px; }
}

body.wiki-page .wiki-hero { --wk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f0ff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5a2 2 0 0 1 2-2h13v16H6a2 2 0 0 0-2 2z'/%3E%3Cpath d='M4 21V5M8 7h7'/%3E%3C/svg%3E"); }
html:has(link[rel="canonical"][href$="/wiki/rebirths"]) body.wiki-page .wiki-hero { --wk: #3b82f6; --wk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f0ff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11a8 8 0 0 0-14.9-4M4 3v4h4'/%3E%3Cpath d='M4 13a8 8 0 0 0 14.9 4M20 21v-4h-4'/%3E%3C/svg%3E"); }
html:has(link[rel="canonical"][href$="/wiki/mutations-et-traits"]) body.wiki-page .wiki-hero { --wk: #d946ef; --wk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f0ff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3c0 6 10 6 10 9s-10 3-10 9M17 3c0 6-10 6-10 9s10 3 10 9'/%3E%3Cpath d='M8.5 7h7M8.5 17h7'/%3E%3C/svg%3E"); }
html:has(link[rel="canonical"][href$="/wiki/taux-de-spawn"]) body.wiki-page .wiki-hero { --wk: #22c55e; --wk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f0ff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='16' height='16' rx='3'/%3E%3Ccircle cx='9' cy='9' r='1.2'/%3E%3Ccircle cx='15' cy='15' r='1.2'/%3E%3Ccircle cx='15' cy='9' r='1.2'/%3E%3Ccircle cx='9' cy='15' r='1.2'/%3E%3Ccircle cx='12' cy='12' r='1.2'/%3E%3C/svg%3E"); }
html:has(link[rel="canonical"][href$="/wiki/niveaux-de-chance"]) body.wiki-page .wiki-hero { --wk: #22c55e; --wk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f0ff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 20v-7M10 20V9M15 20v-5M20 20V4'/%3E%3Cpath d='M3 20h19'/%3E%3C/svg%3E"); }
html:has(link[rel="canonical"][href$="/wiki/machine-eternelle"]) body.wiki-page .wiki-hero { --wk: #38bdf8; --wk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f0ff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3.2'/%3E%3Cpath d='M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9 7 7M17 17l2.1 2.1M4.9 19.1 7 17M17 7l2.1-2.1'/%3E%3C/svg%3E"); }
html:has(link[rel="canonical"][href$="/wiki/lucky-rots"]) body.wiki-page .wiki-hero { --wk: #facc15; --wk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f0ff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1-4.4-4.3 6.1-.9z'/%3E%3C/svg%3E"); }
html:has(link[rel="canonical"][href$="/wiki/box-rots"]) body.wiki-page .wiki-hero { --wk: #14b8a6; --wk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f0ff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7l9-4 9 4-9 4z'/%3E%3Cpath d='M3 7v10l9 4 9-4V7M12 11v10'/%3E%3C/svg%3E"); }
html:has(link[rel="canonical"][href$="/wiki/llama-rots"]) body.wiki-page .wiki-hero { --wk: #fb923c; --wk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f0ff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='9' width='18' height='12' rx='2'/%3E%3Cpath d='M12 9v12M3 13h18M12 9C10 5 6 5 6 7.5S12 9 12 9s6-.5 6-1.5S14 5 12 9'/%3E%3C/svg%3E"); }
html:has(link[rel="canonical"][href$="/wiki/roue"]) body.wiki-page .wiki-hero { --wk: #f43f5e; --wk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f0ff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Cpath d='M12 3v7M12 14v7M3 12h7M14 12h7M5.6 5.6l5 5M13.4 13.4l5 5M18.4 5.6l-5 5M10.6 13.4l-5 5'/%3E%3C/svg%3E"); }
html:has(link[rel="canonical"][href$="/wiki/mecaniques-et-astuces"]) body.wiki-page .wiki-hero { --wk: #a3a3a3; --wk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f0ff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 21h4M12 3a6 6 0 0 0-4 10.5c.8.8 1 1.5 1 2.5h6c0-1 .2-1.7 1-2.5A6 6 0 0 0 12 3z'/%3E%3C/svg%3E"); }
html:has(link[rel="canonical"][href$="/wiki/sprites"]) body.wiki-page .wiki-hero { --wk: #a78bfa; --wk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f0ff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 3l1.8 5.2L18 10l-5.2 1.8L11 17l-1.8-5.2L4 10l5.2-1.8z'/%3E%3Cpath d='M19 15l.8 2.2L22 18l-2.2.8L19 21l-.8-2.2L16 18l2.2-.8z'/%3E%3C/svg%3E"); }
html:has(link[rel="canonical"][href$="/wiki/tous-les-brainrots"]) body.wiki-page .wiki-hero { --wk: #ef4444; --wk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f0ff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='2'/%3E%3Crect x='14' y='3' width='7' height='7' rx='2'/%3E%3Crect x='3' y='14' width='7' height='7' rx='2'/%3E%3Crect x='14' y='14' width='7' height='7' rx='2'/%3E%3C/svg%3E"); }
