/* ============================================================
   TopStats — black & gold theme
   Token names mirror the original layout system.
   ============================================================ */

:root {
  --gradient-start: #14100a;
  --gradient-end: #030201;

  --background: #17130c;
  --background-hover: #241d10;
  --foreground: #f7f2e4;
  --muted-foreground: #a3977a;

  --primary-foreground: #2a2214;
  --primary-foreground-hover: #3d3119;

  --gold: #d4af37;
  --gold-bright: #f2d16b;
  --gold-deep: #8a6d1b;
  --gold-soft: #d4af3733;
  --silver: #c0c0c033;
  --bronze: #cd7f3233;

  --border: #d4af3726;
  --border-strong: #d4af3759;
  --input: #ffffff14;
  --ring: #d4af3799;
  --destructive: #ff6568;

  --radius: 0.8rem;
  --radius-sm: 0.35rem;
  --radius-md: 0.55rem;

  --chart-1: #d4af37;
  --chart-2: #f2d16b;

  --nav-h: 5.5rem;

  color-scheme: dark;
}

* { box-sizing: border-box; }

/* Les icônes inline n'ont pas d'attribut width/height : sans cette règle elles
   prennent toute la place disponible (cas de la flèche « retour »). */
svg { width: 1em; height: 1em; flex: none; }
*::selection { background: var(--gold); color: #100c04; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--foreground);
  background: var(--gradient-end);
  background-image:
    radial-gradient(1200px 600px at 50% -10%, #3a2c0d55 0%, transparent 65%),
    linear-gradient(180deg, var(--gradient-start) 0%, var(--gradient-end) 55%);
  background-attachment: fixed;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; }

/* ------------------------------------------------------------------ shell */

.shell {
  position: relative;
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem;
}
@media (min-width: 1280px) { .shell { max-width: 80vw; } }

.page-band {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  padding-bottom: 0.5rem;
  background: linear-gradient(180deg, var(--gradient-start) 78%, transparent 100%);
  backdrop-filter: blur(6px);
}

/* ------------------------------------------------------------------ navbar */

.nav {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}
@media (min-width: 768px) { .nav { flex-direction: row; } }

.nav-top {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 0.75rem; color: var(--gold); }
.brand-logo {
  width: 3rem;
  height: 3rem;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 14px #d4af3755);
}
@media (min-width: 1024px) { .brand-logo { width: 3.5rem; height: 3.5rem; } }
.brand-name {
  display: none;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@media (min-width: 640px) { .brand-name { display: block; } }

.nav-burger { width: 2.5rem; height: 2.5rem; cursor: pointer; color: var(--gold); }
.nav-burger svg { width: 100%; height: 100%; }
@media (min-width: 768px) { .nav-burger { display: none; } }

.nav-links {
  display: none;
  width: 100%;
  flex-direction: column;
  gap: 0.5rem;
}
.nav-links.open { display: flex; }
@media (min-width: 768px) {
  .nav-links { display: flex; width: auto; flex-direction: row; }
}

.nav-link {
  display: flex;
  height: 3rem;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  font-size: 1.125rem;
  border-radius: var(--radius-md);
  background: var(--background);
  border: 1px solid transparent;
  transition: background-color .2s, color .2s, border-color .2s;
}
.nav-link:hover { background: var(--background-hover); }
.nav-link.active {
  background: var(--background-hover);
  color: var(--gold-bright);
  border-color: var(--border-strong);
  box-shadow: 0 0 18px -6px #d4af3780;
}
.nav-link.icon-only { aspect-ratio: 1; padding: 0; }
.nav-link svg { width: 1.25rem; height: 1.25rem; }

/* ------------------------------------------------------------------ toolbar */

.toolbar {
  position: sticky;
  top: calc(var(--nav-h) + 0.5rem);
  z-index: 30;
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 1rem;
  background: linear-gradient(180deg, var(--gradient-start) 80%, transparent 100%);
}
@media (min-width: 768px) { .toolbar { top: calc(var(--nav-h) + 1rem); flex-direction: row; } }

.search {
  position: relative;
  display: flex;
  min-width: 0;
  width: 100%;
  height: 3.25rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.75rem;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: var(--background);
  transition: border-color .2s, box-shadow .2s;
}
.search:focus-within {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px #d4af3720;
}
.search svg { width: 1.25rem; height: 1.25rem; color: var(--muted-foreground); flex: none; }
.search input {
  flex: 1;
  min-width: 0;
  height: 2.25rem;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--foreground);
  font-size: 1rem;
}
.search input::placeholder { color: var(--muted-foreground); }

.tool-group { display: flex; width: 100%; flex-direction: row; gap: 0.5rem; }
@media (min-width: 768px) { .tool-group { width: auto; } }

.tool-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-size: 1.25rem;
  border-radius: var(--radius-md);
  background: var(--background);
  transition: background-color .2s, color .2s;
}
.tool-btn:hover { background: var(--background-hover); color: var(--gold-bright); }
.tool-btn.active { color: var(--gold-bright); background: var(--background-hover); box-shadow: inset 0 0 0 1px var(--border-strong); }
.tool-btn svg { width: 1em; height: 1em; }
.tool-btn .dot {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  width: 0.45rem; height: 0.45rem;
  border-radius: 999px;
  background: var(--gold);
}

/* popover menus */
.menu-anchor { position: relative; }
.menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 60;
  min-width: 13rem;
  max-height: 20rem;
  overflow: auto;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #0f0c06f2;
  box-shadow: 0 20px 50px -12px #000;
  backdrop-filter: blur(10px);
}
.menu[hidden] { display: none; }
.menu-search {
  position: sticky;
  top: -0.35rem;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: -0.35rem -0.35rem 0.35rem;
  padding: 0.55rem 0.7rem;
  background: #0f0c06;
  border-bottom: 1px solid var(--border);
}
.menu-search svg { color: var(--muted-foreground); }
.menu-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--foreground);
  font-size: 0.9rem;
}
.menu-search input::placeholder { color: var(--muted-foreground); }
.menu-item[hidden] { display: none; }

.menu-label {
  padding: 0.4rem 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  text-align: left;
  transition: background-color .15s, color .15s;
}
.menu-item:hover { background: var(--primary-foreground); }
.menu-item.selected { color: var(--gold-bright); background: var(--primary-foreground); }
.menu-item .check { margin-left: auto; opacity: 0; color: var(--gold); }
.menu-item.selected .check { opacity: 1; }
.menu-item img.flag { width: 1.25rem; border-radius: 2px; }

/* ------------------------------------------------------------------ rows */

.list { display: flex; width: 100%; flex-direction: column; }
.row-wrap { padding-bottom: 0.5rem; }

/* liste virtuelle : la piste porte la hauteur totale, la fenêtre glisse dessus */
.v-track { position: relative; width: 100%; }
.v-window { position: absolute; top: 0; left: 0; right: 0; will-change: transform; }

.row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--background);
  border: 1px solid transparent;
  font-size: 1.125rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  transition: background-color .18s, border-color .18s, transform .18s;
}
.row:hover {
  background: var(--background-hover);
  border-color: var(--border);
  transform: translateY(-1px);
}

.row-left {
  display: flex;
  /* flex:none — sans ça la colonne rétrécit sous la taille du logo (4rem) et
     l'image se retrouve rognée par l'overflow de la ligne. */
  flex: none;
  align-self: stretch;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-direction: column;
  padding-right: 0.25rem;
  margin-left: 1.5rem;
}
@media (min-width: 700px) {
  .row-left { flex-direction: row; margin-left: 0; padding-right: 0; }
}

.row-logo {
  width: 4rem;
  height: 4rem;
  flex: none;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #0b0904 center/cover;
}
@media (min-width: 700px) { .row-logo { border-radius: 0; } }
.row-logo img { width: 100%; height: 100%; object-fit: cover; }

.row-flag { width: 3rem; height: auto; flex: none; border-radius: 3px; object-fit: contain; }
@media (min-width: 700px) { .row-flag { width: 4.5rem; } }

.row-body {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
  overflow-wrap: anywhere;
}
@media (min-width: 768px) { .row-body { flex-direction: row; align-items: center; } }

.row-main { display: flex; min-width: 0; flex: 1; flex-direction: column; justify-content: center; padding: 0.25rem; }
.row-title { font-weight: 600; }
.row-desc { margin: 0; font-size: 0.875rem; color: var(--muted-foreground); }
@media (min-width: 700px) {
  .row-title, .row-desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

.badges { display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 0.875rem; flex-direction: column; }
@media (min-width: 700px) { .badges { flex-direction: row; font-size: 1rem; } }

.badge {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  background: var(--primary-foreground);
  border: 1px solid #d4af3714;
  white-space: nowrap;
}
.badge svg { width: 1em; height: 1em; flex: none; color: var(--gold); }
.badge .muted { color: var(--muted-foreground); }
.badge.link:hover { background: var(--primary-foreground-hover); color: var(--gold-bright); }
.badge.rank-badge { color: var(--gold-bright); }
/* Serveur injoignable au dernier relevé : distinct d'un « 0 » ambigu. */
.badge.offline { color: var(--destructive); background: #ff65681a; border-color: #ff65683d; }
.badge.offline svg { color: var(--destructive); }

/* rank plate (resources list) */
.rank-plate {
  display: flex;
  min-width: 3.25rem;
  align-self: stretch;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.7rem;
  font-weight: 600;
  color: var(--foreground);
  background: var(--primary-foreground);
  /* Un rang à cinq chiffres (22,152) se coupait en deux lignes dans la plaque.
     Elle s'élargit désormais avec le contenu, et le texte rétrécit un peu. */
  white-space: nowrap;
  flex: none;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}
.rank-plate.gold   { background: var(--gold-soft); color: var(--gold-bright); box-shadow: 2px 0 1em 0 var(--gold-soft); }
.rank-plate.silver { background: var(--silver); box-shadow: 2px 0 1em 0 var(--silver); }
.rank-plate.bronze { background: var(--bronze); box-shadow: 2px 0 1em 0 var(--bronze); }

/* La ligne propriétaire est en disposition horizontale : sans cette règle, le
   justify-content:center hérité centrait le nom au milieu du vide. */
.owner-main {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
}

.owner-avatar { width: 1.6rem; height: 1.6rem; border-radius: 999px; object-fit: cover; flex: none; }
.owner-avatar.big { width: 3rem; height: 3rem; }

.trend { display: inline-flex; align-items: center; gap: 0.15rem; font-size: 0.8rem; }
.trend.up { color: #7ddc9a; }
.trend.down { color: var(--destructive); }
.trend.flat { color: var(--muted-foreground); }

.empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--muted-foreground);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

/* ------------------------------------------------------------------ detail */

.detail { display: flex; width: 100%; flex-direction: column; gap: 0.5rem; }

.banner {
  display: none;
  width: 100%;
  max-height: 12vmin;
  margin-bottom: 0.25rem;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
@media (min-width: 768px) { .banner { display: block; } }

.detail-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: var(--background);
  border: 1px solid var(--border);
}
@media (min-width: 768px) { .detail-head { flex-direction: row; } }

.detail-id { display: flex; width: 100%; min-width: 0; flex-direction: column; gap: 1rem; }
.detail-id-top { display: flex; width: 100%; gap: 0.5rem; overflow: hidden; }
.detail-logo { width: 6rem; height: 6rem; flex: none; border-radius: var(--radius-sm); object-fit: cover; background: #0b0904; }
.detail-title { margin: 0; font-size: 1.35rem; font-weight: 700; }
.detail-sub { margin: 0.15rem 0 0; font-size: 0.875rem; color: var(--muted-foreground); overflow-wrap: anywhere; }

.detail-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }
@media (min-width: 768px) { .detail-badges { justify-content: flex-end; } }
.detail-badges .badge { font-size: 0.875rem; }
.detail-badges .badge img.avatar { width: 1.25rem; height: 1.25rem; border-radius: 999px; object-fit: cover; }
.detail-badges .badge img.flag { width: 1.5rem; border-radius: 2px; }

.panels {
  display: flex;
  width: 100%;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
}
@media (min-width: 768px) { .panels { flex-direction: row; min-height: 17.5rem; } }

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--background);
  border: 1px solid var(--border);
}
.panel.grow { flex: 1; }
@media (min-width: 768px) { .panel { height: 40vh; } }

.panel h2 { margin: 0 0 0.5rem; font-size: 1.125rem; font-weight: 600; }
.panel h2 .count { color: var(--muted-foreground); font-weight: 400; }

.search.mini { height: 2.25rem; padding: 0 0.6rem; background: var(--primary-foreground); border-radius: var(--radius-sm); margin-bottom: 0.5rem; }
.search.mini svg { width: 1rem; height: 1rem; }
.search.mini input { height: 1.85rem; font-size: 0.9rem; }

.chips { display: flex; min-height: 0; flex: 1; flex-wrap: wrap; align-content: flex-start; gap: 0.5rem; overflow: auto; }
.chip {
  display: flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  background: var(--primary-foreground);
  transition: background-color .15s, color .15s;
}
.chip:hover { background: var(--primary-foreground-hover); color: var(--gold-bright); }

.chips::-webkit-scrollbar, .menu::-webkit-scrollbar { width: 8px; }
.chips::-webkit-scrollbar-thumb, .menu::-webkit-scrollbar-thumb { background: #d4af3740; border-radius: 8px; }
.chips::-webkit-scrollbar-track, .menu::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------------ chart */

.chart-wrap { position: relative; width: 100%; }
.chart-title { margin-bottom: 0.5rem; font-size: 0.95rem; color: var(--muted-foreground); }
.chart { display: block; width: 100%; height: auto; }
.chart .grid line { stroke: #d4af3720; stroke-width: 1; }
.chart text { fill: var(--muted-foreground); font-size: 10px; }
.chart .area { fill: url(#goldFade); }
.chart .line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cursor { stroke: #d4af3766; stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { fill: var(--gold-bright); stroke: #0b0904; stroke-width: 2; }

.chart-tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  transform: translate(-50%, -130%);
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  background: #0f0c06f2;
  border: 1px solid var(--border-strong);
  box-shadow: 0 10px 30px -10px #000;
}
.chart-tip[hidden] { display: none; }
.chart-tip b { color: var(--gold-bright); }

/* tabs */
.tabs { display: flex; gap: 0.35rem; margin-bottom: 0.75rem; padding: 0.25rem; border-radius: var(--radius-sm); background: var(--primary-foreground); width: fit-content; }
.tab {
  padding: 0.35rem 0.9rem;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--muted-foreground);
  transition: background-color .15s, color .15s;
}
.tab.active { background: var(--gold-soft); color: var(--gold-bright); }

.stat-group { display: flex; flex-direction: column; gap: 0.4rem; }
.stat-group > span { font-size: 0.9rem; color: var(--muted-foreground); }
.stat-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.section-title { margin: 1rem 0 0.5rem; font-size: 1.05rem; font-weight: 600; color: var(--muted-foreground); }

/* ------------------------------------------------------------------ footer ad */

.ad-band {
  position: sticky;
  bottom: 0;
  z-index: 40;
  display: none;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0 1rem;
  /* fond plein et opaque : le bandeau ne doit jamais laisser voir la page
     ni sa propre image de fond au travers pendant un changement de page. */
  background: var(--gradient-end);
  border-top: 1px solid var(--border);
  isolation: isolate;
}
@media (min-width: 768px) { .ad-band { display: flex; } }

.ad {
  position: relative;
  display: flex;
  width: 92%;
  min-height: 7.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem 1.75rem;
  overflow: hidden;
  border-radius: var(--radius);
  color: #f6efdd;
  background-color: #0d0a06;
  background-image: url('../img/topv-social.jpg');
  background-size: cover;
  background-position: center 38%;
  border: 1px solid var(--border);
  transition: border-color .2s, transform .2s;
}
/* voile sombre : garde le texte lisible par-dessus la photo */
.ad::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #05040288 0%, #05040255 55%, #05040288 100%);
}
.ad > * { position: relative; }
.ad:hover { border-color: var(--border-strong); transform: translateY(-1px); }

.ad-left { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.ad-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 14px #000, 0 0 30px #0009;
}
.ad-sub { font-size: 0.9rem; color: #e6dcc2; text-shadow: 0 1px 10px #000; }
.ad-cta {
  flex: none;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: #14100a;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  font-weight: 700;
  box-shadow: 0 6px 24px -8px #000;
}

.skeleton {
  min-height: 4rem;
  width: 100%;
  border-radius: var(--radius-md);
  background: var(--background);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* Respiration sous le contenu, et surtout une hauteur plancher : sans elle,
   la page se raccourcit brutalement pendant un changement d'onglet et le
   bandeau collant du bas remonte en laissant voir sa photo de fond. */
#view {
  padding-bottom: 1.5rem;
  min-height: 70vh;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted-foreground);
}
.back-link:hover { color: var(--gold-bright); }
.back-link svg { width: 1.1em; height: 1.1em; }


/* ------------------------------------------------ fiche ressource / tag */

/* Deux colonnes : statistiques et graphique à gauche, serveurs à droite.
   Empilé sous 1000 px, où la colonne latérale n'aurait plus de place. */
.split { display: flex; width: 100%; flex-direction: column; gap: 0.75rem; }
@media (min-width: 1000px) {
  .split { flex-direction: row; align-items: flex-start; }
  .split-side { width: 30rem; flex: none; position: sticky; top: calc(var(--nav-h) + 1rem); }
  .split-main { flex: 1; min-width: 0; }
}
@media (min-width: 1500px) {
  .split-side { width: 34rem; }
}
.split-side { display: flex; flex-direction: column; gap: 0.5rem; }
.split-side .panel { height: auto; padding: 1.1rem; }
.split-side .detail-title { font-size: 1.75rem; overflow-wrap: anywhere; }
.split-side .stat-row .badge { font-size: 1rem; padding: 0.4rem 0.8rem; }
.split-side .chart-wrap { min-height: 14rem; }
.split-side .stat-group > span {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
/* La recherche reste visible pendant le défilement de la liste. Fond plein :
   sans lui, les lignes défileraient en transparence derrière le champ. */
.split-main .toolbar {
  position: sticky;
  top: calc(var(--nav-h) + 0.5rem);
  z-index: 20;
  padding: 0.25rem 0 0.75rem;
  background: linear-gradient(180deg, var(--gradient-start) 78%, transparent 100%);
}
@media (min-width: 768px) {
  .split-main .toolbar { top: calc(var(--nav-h) + 1rem); }
}

/* chargement progressif */
.list-rows { display: flex; flex-direction: column; }
.list-more { display: flex; justify-content: center; padding: 0.5rem 0 1rem; }
.load-more {
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--gold-bright);
  background: var(--background);
  border: 1px solid var(--border);
  transition: background-color .15s, border-color .15s;
}
.load-more:hover { background: var(--background-hover); border-color: var(--border-strong); }

.meta-line {
  margin: 0.25rem 0 1.25rem;
  font-size: 0.8rem;
  color: var(--muted-foreground);
  text-align: center;
}

/* tags sous le nom d'un serveur */
.chips.tags { flex: none; margin-top: 0.5rem; overflow: visible; }
.chips.tags .chip { font-size: 0.8rem; padding: 0.15rem 0.5rem; }


/* ============================================================
   Adaptation mobile
   Le thème est conçu pour un grand écran ; sous 700 px il faut
   récupérer chaque pixel de largeur et éviter les lignes trop hautes.
   ============================================================ */

@media (max-width: 700px) {
  /* --nav-h sert à caler tout ce qui est collant sous la navbar. Sur mobile
     celle-ci fait la moitié de sa hauteur bureau : sans cette redéfinition,
     la barre de recherche se colle trop bas et recouvre la liste. */
  :root { --nav-h: 3.6rem; }

  body { font-size: 15px; }
  .shell { padding: 0 0.6rem; }
  .page-band { padding-bottom: 0.25rem; }

  /* Navbar : logo plus petit, liens en ligne plutôt qu'empilés */
  .brand-logo { width: 2.4rem; height: 2.4rem; }
  .nav { padding: 0.6rem 0; gap: 0.6rem; }
  .nav-links.open { flex-direction: row; flex-wrap: wrap; }
  .nav-link { height: 2.6rem; padding: 0 0.8rem; font-size: 1rem; }

  /* Barre d'outils : recherche pleine largeur, boutons en dessous */
  .toolbar { gap: 0.4rem; padding-bottom: 0.6rem; }
  .search { height: 2.9rem; }
  .tool-btn { flex: 1; padding: 0.7rem; }

  /* Lignes : les badges s'alignent horizontalement et passent à la ligne,
     au lieu de s'empiler en colonne — sinon chaque ligne fait 250 px de haut. */
  .row-left { margin-left: 0.6rem; gap: 0.5rem; }
  .row-logo { width: 3rem; height: 3rem; }
  .row-flag { width: 2rem; }
  .row { font-size: 1rem; }
  .row-body { padding: 0.5rem 0.4rem; gap: 0.35rem; }
  .row-main { padding: 0; }
  .row-title { font-size: 0.95rem; }
  .row-desc { font-size: 0.78rem; }
  .badges { flex-direction: row; flex-wrap: wrap; gap: 0.3rem; font-size: 0.8rem; }
  .badge { padding: 0.2rem 0.45rem; gap: 0.3rem; }

  /* Fiches : colonne unique, panneaux à hauteur libre */
  .detail-head { padding: 0.6rem; gap: 0.6rem; }
  .detail-logo { width: 4rem; height: 4rem; }
  .detail-title { font-size: 1.1rem; }
  .detail-sub { font-size: 0.8rem; }
  .detail-badges .badge { font-size: 0.78rem; }
  .panel { padding: 0.75rem; height: auto; max-height: 22rem; }
  .panels { gap: 0.4rem; }
  .split-side .detail-title { font-size: 1.3rem; }
  .split-side .stat-row .badge { font-size: 0.85rem; padding: 0.3rem 0.55rem; }

  /* Plaque de rang des ressources : plus étroite */
  .rank-plate { min-width: 2.4rem; font-size: 0.8rem; padding: 0.5rem 0.5rem; }

  .meta-line { font-size: 0.72rem; padding: 0 0.5rem; }
  #view { min-height: 50vh; }

  /* Menus déroulants : ils débordaient de l'écran à droite */
  /* Le menu se plaçait hors écran ou par-dessus la liste : on le contraint à
     la largeur disponible et on le laisse s'ouvrir sous son bouton. */
  .menu {
    position: fixed;
    top: auto;
    left: 0.6rem;
    right: 0.6rem;
    min-width: 0;
    max-width: none;
    max-height: 60vh;
    margin-top: 0.4rem;
  }
  .menu-search { top: 0; }
}

/* Très petits écrans : on masque la description, illisible de toute façon */
@media (max-width: 420px) {
  .row-desc { display: none; }
  .row-logo { width: 2.6rem; height: 2.6rem; }
  .badge svg { display: none; }   /* garder les chiffres, pas les icônes */
  .badge.offline svg { display: inline; }
}

/* Le bandeau publicitaire est masqué sous 768 px (voir .ad-band) :
   on le réaffiche en version compacte, sans photo de fond. */
@media (max-width: 767px) {
  .ad-band { display: flex; padding: 0.5rem 0 0.75rem; }
  .ad {
    width: 100%;
    min-height: 0;
    padding: 0.7rem 0.9rem;
    gap: 0.6rem;
    background-image: none;
  }
  .ad::before { display: none; }
  .ad-title { font-size: 1rem; }
  .ad-sub { display: none; }
  .ad-cta { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
}
