/* Wiki wiki.total-siege.com — mise en page (le socle commun est dans theme.css). */

.muted {
  color: var(--muted);
}

/* --- Barre du haut --- */
.wiki-top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 12, 17, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(82, 64, 45, 0.6);
}
.wiki-top-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 0 var(--gutter);
  max-width: 1440px;
  margin: 0 auto;
}
.wiki-top .brand-name {
  font-size: 17px;
}
.search {
  position: relative;
  flex: 1;
  max-width: 520px;
  margin-left: auto;
}
.search input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a59a88' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center;
  color: var(--text);
  font: 600 15px var(--font-body);
}
.search input::placeholder {
  color: var(--faint);
}
.search input:focus {
  outline: none;
  border-color: var(--gold-soft);
  box-shadow: 0 0 0 3px rgba(229, 184, 66, 0.15);
}
.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  max-height: min(70vh, 460px);
  overflow-y: auto;
}
.search-results a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}
.search-results a small {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.search-results [aria-selected="true"] a,
.search-results a:hover {
  background: rgba(229, 184, 66, 0.1);
  color: var(--gold-hover);
}
.search-results .empty {
  padding: 10px 12px;
  color: var(--muted);
}
.side-toggle {
  display: none;
  width: 42px;
  height: 42px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.side-toggle .bars,
.side-toggle .bars::before,
.side-toggle .bars::after {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: currentColor;
  position: relative;
}
.side-toggle .bars::before,
.side-toggle .bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.side-toggle .bars::before {
  top: -6px;
}
.side-toggle .bars::after {
  top: 6px;
}

/* --- Gabarit --- */
.wiki-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  max-width: 1440px;
  margin: 0 auto;
}
.wiki-side {
  position: sticky;
  top: 62px;
  align-self: start;
  height: calc(100vh - 62px);
  overflow-y: auto;
  padding: 22px 14px 40px var(--gutter);
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
}
.side-title {
  margin: 18px 0 6px 10px;
  color: var(--gold-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.side-title:first-child {
  margin-top: 0;
}
.wiki-side ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.wiki-side a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius);
  color: #d9cfbb;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
}
.wiki-side a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--gold-hover);
}
.wiki-side a[aria-current="page"] {
  background: rgba(229, 184, 66, 0.1);
  color: var(--gold);
  box-shadow: inset 2px 0 0 var(--gold);
}
.wiki-side .ico {
  width: 20px;
  text-align: center;
  flex: none;
}

.wiki-main {
  min-width: 0;
  padding: 28px clamp(16px, 4vw, 48px) 56px;
}
.wiki-main h1 {
  font-size: clamp(30px, 4.5vw, 44px);
  margin-top: 6px;
}
.wiki-main h2 {
  font-size: clamp(22px, 3vw, 28px);
  margin-top: 1.8em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 80px;
}
.wiki-main h3 {
  font-size: 18px;
  margin-top: 1.6em;
  color: var(--gold-soft);
}
.wiki-main [id] {
  scroll-margin-top: 80px;
}
.lead {
  font-size: 18px;
  color: #ddd3bf;
  max-width: 820px;
}
.prose {
  max-width: 820px;
}
.prose p,
.wiki-main > p {
  max-width: 820px;
}
.note {
  font-size: 14px;
  color: var(--muted);
  margin-top: 10px;
}
.data-note {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--faint);
}
.crumbs {
  font-size: 13px;
  color: var(--muted);
}
.crumbs a {
  color: var(--muted);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--gold-hover);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 8px;
}
.toc a {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  background: var(--panel);
}
.toc a:hover {
  border-color: var(--gold-soft);
  color: var(--gold-hover);
}
ul.plain {
  padding-left: 20px;
}
ul.plain li {
  margin: 6px 0;
}

/* Définitions */
.defs {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 20px;
  max-width: 920px;
}
.defs dt {
  font-weight: 800;
  color: var(--gold);
}
.defs dd {
  margin: 0;
  color: #d6ccb8;
}
@media (max-width: 640px) {
  .defs {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .defs dd {
    margin-bottom: 12px;
  }
}

/* Noms avec pastille de couleur */
.tname {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
}
a.tname:hover {
  color: var(--gold-hover);
}
.dot {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 15px;
  background: color-mix(in srgb, var(--c) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
  flex: none;
}
table.data tr.prestige td:first-child {
  color: var(--gold);
}

/* Fiche d'entité */
.entity-head {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 22px;
  margin: 14px 0 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse 60% 120% at 0% 0%, color-mix(in srgb, var(--c) 16%, transparent), transparent 70%),
    var(--panel);
}
.entity-head h1 {
  margin: 0 0 4px;
}
.entity-head .lead {
  margin: 0 0 12px;
}
.entity-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  flex: none;
  font-size: 40px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--c) 18%, #0a0c11);
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  box-shadow: 0 0 30px color-mix(in srgb, var(--c) 25%, transparent);
}
@media (max-width: 560px) {
  .entity-head {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }
  .entity-icon {
    width: 60px;
    height: 60px;
    font-size: 30px;
  }
}
.prevnext {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 36px;
}
.prevnext a {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  text-decoration: none;
  font-weight: 700;
}

/* Accueil */
.wiki-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 34px clamp(18px, 4vw, 40px) 30px;
  margin-bottom: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(10, 12, 17, 0.55), rgba(10, 12, 17, 0.92)),
    url("/assets/shots/colline-large-640.webp") center / cover;
}
.wiki-hero .halo,
.wiki-hero .embers {
  z-index: -1;
}
.wiki-hero h1 {
  font-size: clamp(30px, 5vw, 48px);
}
.wiki-hero .btn {
  margin: 4px 6px 0 0;
}
.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.wcard {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  height: 100%;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.wcard:hover {
  border-color: var(--gold-soft);
  transform: translateY(-2px);
  color: var(--text);
}
.wcard-icon {
  grid-row: span 2;
  font-size: 26px;
}
.wcard-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--gold);
}
.wcard-text {
  font-size: 14px;
  color: var(--muted);
}
.tower-strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tower-strip a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, var(--line));
  background: color-mix(in srgb, var(--c) 9%, var(--panel));
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}
.tower-strip a:hover {
  color: var(--gold-hover);
}
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 18px 0;
}
.kpis div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  text-align: center;
}
.kpis strong {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--gold);
}
.kpis span {
  font-size: 13px;
  color: var(--muted);
}
@media (max-width: 640px) {
  .kpis {
    grid-template-columns: 1fr 1fr;
  }
}

/* Modes */
.mode-sec {
  margin-top: 10px;
}
.media-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
  align-items: start;
}
.media-row img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}
.media-row .prose p:first-child {
  margin-top: 0;
}
@media (max-width: 900px) {
  .media-row {
    grid-template-columns: 1fr;
  }
}

/* Cartes */
.map-list {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}
.map-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}
.map-card h2 {
  margin-top: 0;
  border: 0;
  padding: 0;
}
.map-shot img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.uses {
  font-size: 14px;
  color: var(--muted);
}
@media (max-width: 860px) {
  .map-card {
    grid-template-columns: 1fr;
  }
}

/* Packs */
.spotlight {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 22px;
  align-items: center;
  margin: 22px 0;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: radial-gradient(ellipse 60% 90% at 0% 0%, rgba(229, 184, 66, 0.1), transparent 70%), var(--panel);
}
.spotlight h2 {
  margin-top: 0;
  border: 0;
  padding: 0;
}
.spot-shots {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
}
.spot-shots a {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #4c5c4a;
}
.spot-shots a:first-child {
  grid-row: span 2;
}
.spot-shots img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 900px) {
  .spotlight {
    grid-template-columns: 1fr;
  }
}
.pack-sec {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.pack-sec h2 {
  margin-top: 0;
  border: 0;
  padding: 0;
}
.pack-media img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
details {
  margin-top: 6px;
}
details summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--gold);
}
.name-tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.name-tables table.data th,
.name-tables table.data td {
  white-space: normal;
}
@media (max-width: 760px) {
  .pack-sec {
    grid-template-columns: 1fr;
  }
}

/* --- Mobile : sommaire en tiroir --- */
@media (max-width: 900px) {
  .side-toggle {
    display: block;
  }
  .wiki-layout {
    grid-template-columns: 1fr;
  }
  .wiki-side {
    position: fixed;
    top: 62px;
    left: 0;
    bottom: 0;
    height: auto;
    width: min(300px, 86vw);
    z-index: 30;
    background: #0c0f15;
    border-right: 1px solid var(--border);
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    visibility: hidden;
  }
  .wiki-side.open {
    transform: none;
    visibility: visible;
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.6);
  }
  .top-play {
    display: none;
  }
}
@media (max-width: 560px) {
  .wiki-top-inner {
    flex-wrap: wrap;
    gap: 8px 10px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }
  .wiki-side {
    top: 110px;
  }
}
