/* SixStarMods, wiki de GTA VI : menu des rubriques a gauche, tableaux (modeles) et fiches (le reste) */
:root {
  --night: #0c0d1b;
  --night-2: #18182d;
  --card: #1a1a31;
  --pink: #ffb2c6;
  --lavender: #d8cff0;
  --muted: #aba4c9;
  --top: 61px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { margin: 0; background: var(--night); }
body { margin: 0; }

/* Fond nuit en degrade, comme le site GTA VI de Rockstar */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(189deg, #1f1f38 0.5%, #18182d 30%, #111222 65%, #0c0d1b 100%);
}

body {
  color: #ffffff;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 28px;
  padding: 10px max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left));
  background: rgba(12, 13, 27, 0.8);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand { display: flex; align-items: center; padding: 8px 0; color: #ffffff; text-decoration: none; transition: color 0.2s ease; }
.brand:hover { color: var(--pink); }
.brand svg { display: block; width: 40px; height: auto; fill: currentColor; }
.nav { display: flex; align-items: center; flex-wrap: wrap; gap: 0 22px; }
.nav a { color: #d9cff0; text-decoration: none; font-weight: 600; font-size: 15px; padding: 11px 0; }
.nav a:hover { color: #ffffff; }
.nav [aria-current="page"] { color: #ffffff; font-weight: 700; font-size: 15px; padding: 9px 0; border-bottom: 2px solid var(--pink); }

/* Deux colonnes sur toute la largeur : le menu des rubriques colle au bord gauche, puis la rubrique ouverte */
.wiki {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: calc(100vh - var(--top));
}

.side {
  position: sticky;
  top: var(--top);
  align-self: start;
  height: calc(100vh - var(--top));
  display: flex;
  flex-direction: column;
  padding: 28px 16px 20px max(20px, env(safe-area-inset-left));
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 13, 27, 0.35);
}

.side-toggle { display: none; }

/* Le menu defile s'il le faut ; la carte YouTube reste en bas, toujours visible */
.side-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.side-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-right: -6px;
  padding-right: 6px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
/* Categories repliables : un clic sur le titre */
.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 10px 0 2px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: 600 12px "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}
.side-head:hover { color: #ffffff; background: rgba(255, 255, 255, 0.04); }
.side-head svg { flex: 0 0 auto; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s ease; }
.side-sec.is-closed .side-head svg { transform: rotate(-90deg); }
.side-sec.is-closed .side-links { display: none; }
.side-sec:first-child .side-head { margin-top: 0; }
.side-links { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  color: #d9cff0;
  text-decoration: none;
  font: 600 15px Inter, system-ui, sans-serif;
  transition: background 0.15s ease, color 0.15s ease;
}
.side-link:hover { background: rgba(255, 255, 255, 0.06); color: #ffffff; }
.side-link .n { font: 500 12px "IBM Plex Mono", ui-monospace, monospace; color: var(--muted); }
.side-link[aria-current="true"] { background: rgba(255, 178, 198, 0.14); color: var(--pink); }
.side-link[aria-current="true"] .n { color: var(--pink); }

/* Chaine YouTube : petite carte sous le menu, discrete */
.yt {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #ffffff;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.yt:hover { border-color: rgba(255, 178, 198, 0.5); background: rgba(255, 178, 198, 0.06); }
/* Logo YouTube (rouge et blanc, comme sur YouTube) */
.yt-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
}
.yt-icon svg { display: block; width: 32px; height: auto; }
.yt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.yt-text strong { font: 700 13px/1.3 Inter, system-ui, sans-serif; }
.yt-text span { font: 500 12px/1.3 Inter, system-ui, sans-serif; color: var(--muted); }

/* Rubrique ouverte */
.content {
  min-width: 0;
  padding: 40px max(20px, env(safe-area-inset-right)) 64px 48px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.intro { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }

.eyebrow {
  margin: 0;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pink);
}

.intro h1 {
  margin: 0;
  font-family: Archivo, "Arial Narrow", sans-serif;
  font-weight: 850;
  font-stretch: 78%;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.01em;
}

.lede { margin: 0; font-size: 17px; line-height: 1.6; color: var(--lavender); }

/* Recherche et filtres */
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }

.search {
  flex: 1 1 280px;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search:focus-within { border-color: rgba(255, 178, 198, 0.75); box-shadow: 0 0 0 4px rgba(255, 178, 198, 0.14); }
.search input:focus { outline: none; }
.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  cursor: pointer;
  background: center / 16px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d8cff0' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
}
.search svg { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.search input { flex: 1 1 auto; min-width: 0; border: 0; outline: none; background: transparent; color: #ffffff; font: 500 16px Inter, system-ui, sans-serif; padding: 11px 0; }
.search input::placeholder { color: #a99cc8; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; flex-basis: 100%; }

.filter {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: #ffffff;
  font: 600 14px Inter, system-ui, sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.filter span { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; color: var(--muted); }
.filter[aria-pressed="true"] { background: var(--pink); border-color: var(--pink); color: #0c0d1b; }
.filter[aria-pressed="true"] span { color: #0c0d1b; }

.count { margin: 0; flex-basis: 100%; font-size: 14px; color: var(--muted); }

/* Tableaux des modeles : une grille de colonnes par rubrique */
.table {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
}

.row {
  display: grid;
  align-items: center;
  gap: 0 8px;
  padding: 0 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.t-vehicles .row { grid-template-columns: 136px minmax(0, 1fr) minmax(0, 1fr) 124px 128px; }
.t-weapons .row { grid-template-columns: 136px minmax(0, 1fr) 130px 124px 128px; }
.t-animals .row { grid-template-columns: 136px minmax(0, 1fr) 120px 120px 124px 128px; }
.t-peds .row { grid-template-columns: minmax(0, 1fr) 150px 124px 128px; }

.row.head {
  border-top: 0;
  padding: 12px 10px;
  background: var(--night-2);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.row.head span { padding: 0 8px; }

.info {
  min-width: 0;
  padding: 0 8px;
  font-size: 14px;
  color: var(--lavender);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.info.family { color: var(--muted); }
.info.ingame { white-space: normal; }

.icon { display: flex; align-items: center; justify-content: center; min-height: 60px; padding: 6px 8px; }
.icon img { display: block; width: 120px; height: 48px; object-fit: contain; }
/* Vignette du menu du jeu (vehicules, animaux) : image 2:1 avec son decor */
.icon.pic img { height: 60px; object-fit: cover; border-radius: 6px; }
/* Image cliquable : s'ouvre en grand */
.icon .zoom { display: block; padding: 0; border: 0; border-radius: 6px; background: none; cursor: zoom-in; }
.icon .zoom img { transition: filter 0.15s ease, transform 0.15s ease; }
.icon .zoom:hover img { filter: brightness(1.12); transform: scale(1.03); }
.icon .zoom:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
/* Vehicule sans vignette du jeu mais avec des versions speciales : un bouton a la place de l'image */
.icon .zoom.noimg {
  width: 120px;
  height: 60px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  color: var(--lavender);
  font: 600 12px "IBM Plex Mono", ui-monospace, monospace;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.icon .zoom.noimg:hover { border-color: var(--pink); color: var(--pink); }

/* Fenetre d'une image en grand (cadre commun .dlg plus bas) */
.pic-dialog.has-variants { width: min(860px, calc(100vw - 32px)); }
.pic-dialog .dlg-titles h2 { overflow-wrap: anywhere; }
.pdlg-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.pdlg-pic { display: grid; place-items: center; padding: 18px; }
.pdlg-pic img { display: block; max-width: 100%; height: auto; border-radius: 12px; }

/* Variantes d'une arme (armes uniques du jeu) : une carte par variante, image a la taille du jeu */
.icon .zoom { position: relative; }
.nvar {
  position: absolute;
  right: -8px;
  bottom: -6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--pink);
  color: #17172c;
  font: 700 11px/1.5 "IBM Plex Mono", ui-monospace, monospace;
  pointer-events: none;
}
.pdlg-var { padding: 0 18px 20px; }
.pdlg-var h3 {
  margin: 2px 0 12px;
  font-family: Archivo, "Arial Narrow", sans-serif;
  font-weight: 800;
  font-stretch: 85%;
  font-size: 20px;
  letter-spacing: 0.01em;
}
.pdlg-var-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pdlg-var-item { padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); }
.pdlg-var-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.pdlg-var-name { margin: 9px 2px 3px; font: 600 15px/1.3 Inter, system-ui, sans-serif; color: #ffffff; overflow-wrap: anywhere; }
.pdlg-var-desc { margin: 0 2px; font: 400 13px/1.5 Inter, system-ui, sans-serif; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .icon .zoom img { transition: none; } }

.val {
  min-width: 0;
  min-height: 42px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  font: 500 14px "IBM Plex Mono", ui-monospace, monospace;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.val:hover { background: rgba(255, 178, 198, 0.12); color: var(--pink); }
.row .val.name { font-family: Inter, system-ui, sans-serif; font-weight: 600; font-size: 15px; white-space: normal; overflow-wrap: anywhere; padding-top: 8px; padding-bottom: 8px; line-height: 1.35; }
.val.hex, .val.dec { color: var(--lavender); }

/* Fiches */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 16px 12px 12px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  text-align: center;
}

.card .pic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 112px;
}
.card .pic img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }

/* Blips : icone comme sur la carte du jeu */
.card.blip .pic { height: 76px; }
.card.blip .pic img { width: 64px; height: 64px; }

/* Fenetre : en-tete fixe, contenu qui defile */
html.has-dialog { overflow: hidden; }
.dlg {
  width: min(620px, calc(100vw - 32px));
  max-height: min(78vh, 760px);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: #17172c;
  color: #ffffff;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}
.dlg[open] { display: flex; flex-direction: column; animation: dlg-in 0.22s ease; }
.dlg::backdrop { background: rgba(6, 6, 16, 0.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }

.dlg-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.dlg-titles { min-width: 0; flex: 1 1 auto; }
.dlg-titles h2 {
  margin: 0;
  font-family: Archivo, "Arial Narrow", sans-serif;
  font-weight: 850;
  font-stretch: 80%;
  font-size: 28px;
  line-height: 1.05;
}
.dlg-count { margin: 4px 0 0; font: 500 13px "IBM Plex Mono", ui-monospace, monospace; color: var(--muted); }
.dlg-close {
  flex: 0 0 auto;
  align-self: flex-start;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s ease;
}
.dlg-close:hover { background: rgba(255, 178, 198, 0.2); }
.dlg-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

@media (max-width: 700px) {
  .dlg { width: calc(100vw - 20px); max-height: 86vh; border-radius: 18px; }
  .dlg-head { padding: 14px 14px 12px; gap: 12px; }
  .dlg-titles h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { .dlg[open] { animation: none; } }

.card .vals { display: flex; flex-direction: column; align-items: stretch; gap: 2px; width: 100%; }
.card .val {
  min-height: 34px;
  padding: 4px 8px;
  text-align: center;
  font-size: 13px;
  white-space: normal;
  overflow-wrap: break-word;
}

/* Rubriques Jason & Lucia (relation, profil criminel) : la fiche, puis les icones du jeu */
.secdoc {
  margin: 0;
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}
.secdoc .doc-levels {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}
.secdoc .doc-levels.is-detailed { grid-template-columns: minmax(0, 1fr); }
.secdoc .doc-level {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}
.secdoc .doc-levels.is-detailed .doc-level { align-items: flex-start; }
.secdoc .doc-level > img { flex: 0 0 auto; width: 44px; height: 44px; object-fit: contain; }
.secdoc .doc-ltxt { min-width: 0; }
.secdoc .doc-lname { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 16px; font-weight: 700; color: #ffffff; }
.secdoc .doc-rank { font: 600 12px "IBM Plex Mono", ui-monospace, monospace; letter-spacing: 0.04em; color: var(--pink); }
.secdoc .doc-ldesc { margin: 4px 0 0; font-size: 14px; line-height: 1.55; color: var(--lavender); }
.secdoc .doc-sections { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px 24px; }
.secdoc h3 {
  margin: 0 0 6px;
  font: 600 12px "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pink);
}
.secdoc .doc-section ul { margin: 0; padding-left: 18px; }
.secdoc .doc-section li { font-size: 14px; line-height: 1.55; color: var(--lavender); }
.secdoc .doc-section li + li { margin-top: 4px; }
.secdoc .doc-source { margin: 16px 0 0; font-size: 12px; color: var(--muted); }

.empty { margin: 0; font-size: 15px; color: var(--muted); }

.source {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 20px;
}

/* Petit message « Copied » en bas */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--pink);
  color: #0c0d1b;
  font: 600 14px Inter, system-ui, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

button:focus-visible, a:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
.val:focus-visible, .side-link:focus-visible { outline-offset: -2px; }

/* Fenetre moyenne : la vignette des vehicules et des animaux passe au-dessus de la ligne, pour laisser sa
   largeur au nom du modele (sinon il s'ecrase sous 1240 px avec le menu ouvert) */
@media (min-width: 701px) and (max-width: 1240px) {
  .t-vehicles .row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 124px 128px; }
  .t-animals .row { grid-template-columns: minmax(0, 1fr) 120px 120px 124px 128px; }
  .t-vehicles .icon.pic, .t-animals .icon.pic { grid-column: 1 / -1; justify-content: flex-start; min-height: 0; padding: 8px 8px 0; }
  .t-vehicles .icon.pic.is-empty, .t-animals .icon.pic.is-empty { display: none; }
  .t-vehicles .row.head span:first-child, .t-animals .row.head span:first-child { display: none; }
}

/* Ecran moyen : le menu passe au-dessus, replie derriere un bouton */
@media (max-width: 900px) {
  .wiki { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: sticky;
    top: var(--top);
    z-index: 4;
    height: auto;
    overflow: visible;
    padding: 10px max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left));
    border-right: 0;
    background: rgba(12, 13, 27, 0.92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .side-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    font: 700 15px Inter, system-ui, sans-serif;
    cursor: pointer;
  }
  .side-toggle .grp { font: 600 12px "IBM Plex Mono", ui-monospace, monospace; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pink); margin-right: 8px; }
  .side-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s ease; }
  .side-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .side-panel {
    display: none;
    max-height: calc(100vh - var(--top) - 80px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px 0 4px;
  }
  .side.is-open .side-panel { display: block; }
  .side-nav { overflow: visible; margin-right: 0; padding-right: 0; }
  .content { padding: 28px max(20px, env(safe-area-inset-right)) 64px max(20px, env(safe-area-inset-left)); }
}

@media (max-width: 700px) {
  .search { max-width: none; }
  .row,
  .t-vehicles .row, .t-weapons .row, .t-animals .row, .t-peds .row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 6px 8px; }
  .row .val.name { grid-column: 1 / -1; }
  .row.head { display: none; }
  .t-weapons .info.family, .t-peds .info.family, .t-vehicles .info.ingame { grid-column: 1 / -1; }
  /* Vignette au-dessus du nom, pour que le nom garde toute la ligne */
  .t-weapons .icon, .t-vehicles .icon, .t-animals .icon { grid-column: 1 / -1; justify-content: flex-start; min-height: 0; padding: 8px 8px 0; }
  .t-weapons .icon img { object-position: left center; }
  .t-weapons .icon.is-empty, .t-vehicles .icon.is-empty, .t-animals .icon.is-empty { display: none; }
  .info { padding: 2px 8px 6px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .card { padding: 12px 8px 10px; }
  .secdoc { padding: 16px 14px; }
  .secdoc .doc-levels { grid-template-columns: minmax(0, 1fr); }
}

/* Arrivee sur la page : le contenu monte en douceur */
.content { animation: page-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { .content { animation: none; } .toast, .side-toggle svg { transition: none; } }

/* Discord : tout a droite de la barre du haut */
.discord { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 999px; color: #d9cff0; text-decoration: none; font-weight: 600; font-size: 14px; transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease; }
.discord svg { display: block; width: 18px; height: 18px; fill: currentColor; }
.discord:hover, .discord:focus-visible { color: #ffffff; background: #5865f2; border-color: #5865f2; }
@media (max-width: 640px) {
  .discord { width: 36px; padding: 0; justify-content: center; }
  .discord span { display: none; }
  .topbar { column-gap: 16px; }
  .nav { column-gap: 16px; }
}
