/* rev 2026-09-02f */
:root {
  --red: #e60012;
  --orange: #e0812a;
  --bg: #f4f5f7;
  --card: #fff;
  --input-bg: #fff;
  --th-bg: #fafafa;
  --row-hover: #fff8f8;
  --line: #e0e2e6;
  --text: #1b1d21;
  --muted: #6b7079;
  --sc: #d98f00;
  --mc-good: #1a7f37;
  --mc-mid: #b58900;
  --mc-bad: #cf222e;
  --clz: #1a7f37;
  --shadow: 0 12px 32px rgba(0, 0, 0, .25);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16181d;
    --card: #1e2127;
    --input-bg: #262a31;
    --th-bg: #22262e;
    --row-hover: #262a31;
    --line: #343941;
    --text: #e7e9ec;
    --muted: #9aa1ab;
    --sc: #f0b429;
    --mc-good: #4ac26b;
    --mc-mid: #d9a441;
    --mc-bad: #ff6b6b;
    --clz: #4ac26b;
    --shadow: 0 12px 32px rgba(0, 0, 0, .6);
  }
}

:root[data-theme="dark"] {
  --bg: #16181d;
  --card: #1e2127;
  --input-bg: #262a31;
  --th-bg: #22262e;
  --row-hover: #262a31;
  --line: #343941;
  --text: #e7e9ec;
  --muted: #9aa1ab;
  --sc: #f0b429;
  --mc-good: #4ac26b;
  --mc-mid: #d9a441;
  --mc-bad: #ff6b6b;
  --clz: #4ac26b;
  --shadow: 0 12px 32px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 14px/1.45 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
.topbar {
  display: flex; align-items: baseline; gap: 1.5rem; flex-wrap: wrap;
  padding: 1rem 1.5rem; background: var(--card); border-bottom: 3px solid var(--red);
}
.topbar h1 { margin: 0; font-size: 1.25rem; letter-spacing: -.01em; }
.stats { color: var(--muted); font-size: .85rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.stats b { color: var(--text); }
.theme-toggle {
  margin-left: auto; font: inherit; cursor: pointer; line-height: 1;
  padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 6px;
  background: var(--input-bg); color: var(--text);
}
.theme-toggle:hover { border-color: var(--red); }

.logout-link {
  font-size: .8rem; color: var(--muted); text-decoration: none;
  padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 6px;
}
.logout-link:hover { border-color: var(--red); color: var(--text); }

.filters {
  display: flex; gap: .6rem; flex-wrap: wrap; align-items: center;
  padding: .8rem 1.5rem; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.filters input, .filters select, .filters button {
  font: inherit; padding: .35rem .5rem; border: 1px solid var(--line);
  border-radius: 6px; background: var(--input-bg); color: var(--text);
}
.filters input[type=search] { min-width: 220px; }
.filters .inline { display: flex; align-items: center; gap: .35rem; color: var(--muted); }
.filters button { cursor: pointer; }
#f-reset { border-color: var(--red); color: var(--red); }

.filters-spacer { flex: 1 1 auto; }
#sort-box.hint span { color: var(--red); font-weight: 600; }
.view-toggle {
  display: inline-flex; border: 1px solid var(--line);
  border-radius: 6px; overflow: hidden;
}
.view-toggle button {
  font: inherit; border: 0; border-radius: 0; padding: .35rem .7rem;
  background: var(--input-bg); color: var(--muted); cursor: pointer;
}
.view-toggle button + button { border-left: 1px solid var(--line); }
.view-toggle button.active { background: var(--red); color: #fff; font-weight: 600; }

/* Multi-select (filtres à cases à cocher) */
.ms { position: relative; }
.ms-btn {
  font: inherit; padding: .35rem .5rem; border: 1px solid var(--line);
  border-radius: 6px; background: var(--input-bg); color: var(--text);
  cursor: pointer; max-width: 15rem; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.ms-btn.active { border-color: var(--red); color: var(--text); font-weight: 600; }
.ms-btn::after { content: " ▾"; color: var(--muted); }
.ms-panel {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 30;
  width: 17rem; max-width: 80vw; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow);
  padding: .5rem;
}
.ms-search { width: 100%; margin-bottom: .4rem; }
.ms-actions { display: flex; justify-content: flex-end; margin-bottom: .3rem; }
.ms-actions button {
  font: inherit; font-size: .8rem; padding: .15rem .45rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: 5px;
  background: var(--input-bg); color: var(--muted);
}
.ms-list { max-height: 15rem; overflow-y: auto; }
.ms-list label {
  display: flex; align-items: center; gap: .45rem; padding: .25rem .2rem;
  font-size: .88rem; cursor: pointer; border-radius: 4px;
}
.ms-list label[hidden] { display: none !important; }
.ms-list label:hover { background: var(--row-hover); }
.ms-list label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { padding: 0 1.5rem 3rem; }

/* --- Vue grille --- */
#games[hidden], .grid[hidden] { display: none !important; }
.grid {
  display: grid; gap: 1rem; padding: 1rem 0 2rem;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; display: flex; flex-direction: column;
}
.card-cover {
  position: relative; aspect-ratio: 3 / 4; background: var(--th-bg);
  display: flex; align-items: center; justify-content: center;
}
.card-cover img { width: 100%; height: 100%; object-fit: contain; }
.card-noimg { font-size: 2.5rem; font-weight: 700; color: var(--muted); }
.card-play { position: absolute; right: .4rem; bottom: .4rem; }
.card-play a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.9rem; height: 1.9rem; border-radius: 50%; font-size: .8rem;
  background: rgba(0, 0, 0, .65); color: #fff; text-decoration: none;
}
.card-play a:hover { background: var(--red); }
.card-body {
  flex: 1; display: flex; flex-direction: column; gap: .35rem;
  padding: .6rem .7rem .7rem;
}
.card-title { margin: 0; font-size: .9rem; line-height: 1.25; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--red); }
.card-meta {
  display: flex; flex-wrap: wrap; gap: .4rem; font-size: .78rem;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.card-meta .sc { color: var(--sc); font-weight: 600; }
.card-meta .mc.mc-good { color: var(--mc-good); }
.card-meta .mc.mc-mid { color: var(--mc-mid); }
.card-meta .mc.mc-bad { color: var(--mc-bad); }
.card-sub {
  font-size: .76rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-phys { margin-top: auto; }
.card-phys select {
  width: 100%; font: inherit; padding: .2rem .3rem;
  border: 1px solid var(--line); border-radius: 5px;
  background: var(--input-bg); color: var(--text);
}
.card.src-manual .card-phys select { border-color: var(--red); }

/* Statut « Inconnu » : contour orange (prime sur le rouge de src-manual). */
select.phys-sel.phys-unknown { border-color: var(--orange) !important; }

.table-hint {
  margin: .7rem 0 .4rem; font-size: .82rem; color: var(--muted);
  display: flex; align-items: center; gap: .3rem; flex-wrap: wrap;
}
.table-hint b { color: var(--text); }
.table-hint kbd {
  font: inherit; font-size: .78rem; padding: .05rem .35rem;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
  background: var(--input-bg); color: var(--text);
}
.table-hint .hint-badge {
  display: inline-block; padding: 0 .3rem; margin: 0 .05rem;
  font-size: .7rem; font-weight: 700; color: #fff; background: var(--red);
  border-radius: 999px; vertical-align: middle;
}
table { border-collapse: collapse; width: 100%; background: var(--card); }
thead th {
  position: sticky; top: 53px; background: var(--th-bg); text-align: left;
  padding: .55rem .6rem; border-bottom: 2px solid var(--line); font-size: .8rem;
  text-transform: uppercase; letter-spacing: .03em; color: var(--muted); white-space: nowrap;
}
thead th[data-sort] { cursor: pointer; user-select: none; }
thead th[data-sort]:hover { color: var(--text); }
th.sorted-asc::after { content: " ▲"; color: var(--red); }
th.sorted-desc::after { content: " ▼"; color: var(--red); }
th .sort-badge {
  display: inline-block; margin-left: .2rem; padding: 0 .3rem;
  font-size: .7rem; font-weight: 700; color: #fff; background: var(--red);
  border-radius: 999px; vertical-align: super;
}
tbody td { padding: .45rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover { background: var(--row-hover); }
.title-cell a { color: var(--text); text-decoration: none; font-weight: 600; }
.title-cell a:hover { color: var(--red); text-decoration: underline; }
.title-cell .orig { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; }
.rating { font-variant-numeric: tabular-nums; font-weight: 600; }
.rating.sc { color: var(--sc); }
.rating.mc-good { color: var(--mc-good); }
.rating.mc-mid { color: var(--mc-mid); }
.rating.mc-bad { color: var(--mc-bad); }
.muted { color: var(--muted); }
.tags { color: var(--muted); font-size: .85rem; }

td.phys select {
  font: inherit; padding: .2rem .3rem; border: 1px solid var(--line);
  border-radius: 5px; background: var(--input-bg); color: var(--text);
}
td.phys.src-manual select { border-color: var(--red); }
td.phys.src-clz select { border-color: var(--clz); }
td.phys .src { display: block; font-size: .7rem; color: var(--muted); }
td.phys.src-clz .src { color: var(--clz); font-weight: 600; }
td.phys.src-manual .src { color: var(--red); font-weight: 600; }

.empty { padding: 2rem; text-align: center; color: var(--muted); }

.pager {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; gap: .8rem;
  align-items: center; justify-content: center; padding: .6rem;
  background: var(--card); border-top: 1px solid var(--line);
}
.pager button {
  font: inherit; padding: .35rem .8rem; border: 1px solid var(--line);
  border-radius: 6px; background: var(--input-bg); color: var(--text); cursor: pointer;
}
.pager button:disabled { opacity: .4; cursor: default; }
.pager select {
  font: inherit; padding: .3rem; border: 1px solid var(--line);
  border-radius: 6px; background: var(--input-bg); color: var(--text);
}

.cover-pop {
  position: fixed; z-index: 50; pointer-events: none;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  box-shadow: var(--shadow); background: var(--card);
}
.cover-pop img { display: block; width: 220px; height: auto; }

.gameplay a { color: var(--sc); text-decoration: none; font-size: .85rem; white-space: nowrap; }
.gameplay a:hover { text-decoration: underline; }

.video-pop {
  position: fixed; z-index: 51; pointer-events: none;
  width: 400px; height: 225px; border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); background: #000;
}
.video-pop iframe { display: block; width: 100%; height: 100%; border: 0; }

/* Pop-up vidéo au clic : superposée à la page, ne quitte pas le site */
.video-modal[hidden] { display: none !important; }
.video-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .78);
}
.video-modal .vm-frame {
  width: min(92vw, 960px); height: min(51.75vw, 540px);
  background: #000; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow);
}
.video-modal .vm-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.video-modal .vm-close {
  position: fixed; top: 1.1rem; right: 1.3rem;
  font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer;
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .5);
  background: rgba(20, 20, 20, .85); color: #fff;
}
.video-modal .vm-close:hover { background: var(--red); border-color: var(--red); }

/* Prix médian */
.mprice {
  color: var(--sc); font-weight: 600; cursor: pointer; text-decoration: none;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.mprice:hover { text-decoration: underline; }
.mprice small { color: var(--muted); font-weight: 400; }
.mp-btn {
  font: inherit; font-size: .78rem; padding: .2rem .5rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: 5px;
  background: var(--input-bg); color: var(--muted); white-space: nowrap;
}
.mp-btn:hover:not(:disabled) { border-color: var(--red); color: var(--text); }
.mp-btn:disabled { opacity: .6; cursor: default; }

/* Indice de rareté (nombre d'annonces actives trouvées) */
.rarity {
  display: inline-flex; align-items: center; gap: .3rem;
  margin-left: .35rem; padding: .05rem .4rem .05rem .3rem;
  border: 1px solid currentColor; border-radius: 999px;
  font-size: .62rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .02em; white-space: nowrap; vertical-align: middle;
}
.rarity .dots { display: inline-flex; gap: 1.5px; }
.rarity .dot {
  width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .28;
}
.rarity .dot.on { opacity: 1; }
.rarity.r-common { color: var(--mc-good); }
.rarity.r-uncommon { color: var(--sc); }
.rarity.r-rare { color: #e0812a; }
.rarity.r-veryrare { color: var(--red); }
.card-sub .rarity, .rarity-cell .rarity { margin-left: 0; }

.price-modal[hidden] { display: none !important; }
.price-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .78); padding: 1.5rem;
}
.price-modal .pm-box {
  position: relative; width: min(92vw, 680px); max-height: 82vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 1.3rem 1.4rem;
}
.price-modal .pm-close {
  position: absolute; top: .8rem; right: 1rem; width: 2rem; height: 2rem;
  font: inherit; font-size: 1.2rem; cursor: pointer; border-radius: 50%;
  border: 1px solid var(--line); background: var(--input-bg); color: var(--text);
}
.price-modal .pm-close:hover { background: var(--red); border-color: var(--red); color: #fff; }
.price-modal h3 { margin: 0 1.5rem .4rem 0; font-size: 1.05rem; }
.pm-summary {
  margin: 0 0 .9rem; font-size: .9rem; display: flex; align-items: center;
  flex-wrap: wrap; gap: .5rem;
}
.pm-summary b { color: var(--sc); font-size: 1.05rem; }
.pm-list { display: flex; flex-direction: column; gap: .1rem; }
.pm-row {
  display: grid; grid-template-columns: 44px 1fr auto auto; gap: .6rem;
  align-items: center; padding: .4rem .3rem; border-radius: 6px;
  text-decoration: none; color: var(--text);
}
.pm-row:hover { background: var(--row-hover); }
.pm-row img, .pm-row .pm-noimg {
  width: 44px; height: 44px; object-fit: cover; border-radius: 4px;
  background: var(--th-bg);
}
.pm-title { font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-plat {
  font-size: .7rem; font-weight: 700; padding: .1rem .4rem; border-radius: 999px;
  color: #fff;
}
.pm-plat.plat-ebay { background: #0064d2; }
.pm-plat.plat-vinted { background: #09b1ba; }
.pm-price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pm-price small { color: var(--muted); font-weight: 400; }
.pm-fr {
  display: inline-block; font-size: .65rem; font-weight: 800; letter-spacing: .03em;
  padding: .05rem .3rem; border-radius: 4px; background: var(--mc-good); color: #fff;
  vertical-align: middle;
}

/* ============================================================
   MOBILE  (smartphone)
   ============================================================ */
.f-toggle { display: none; }

@media (max-width: 760px) {
  body { font-size: 15px; }

  /* --- En-tête compact (non collant sur mobile : trop haut avec les stats) --- */
  .topbar {
    flex-wrap: wrap; gap: .5rem; padding: .6rem .8rem; border-bottom-width: 2px;
  }
  .topbar h1 { font-size: 1rem; flex: 1 1 auto; }
  .theme-toggle, .logout-link { padding: .35rem .5rem; font-size: .8rem; }
  #stats {
    order: 3; flex-basis: 100%; gap: .5rem 1rem; font-size: .72rem;
    max-height: none; overflow-x: auto; white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  #stats span { white-space: nowrap; }

  /* --- Filtres : repliés derrière un bouton --- */
  .f-toggle {
    display: block; width: 100%; position: sticky; top: 0; z-index: 15;
    font: inherit; font-weight: 700; text-align: left;
    padding: .7rem 1rem; border: 0; border-bottom: 1px solid var(--line);
    background: var(--card); color: var(--text); cursor: pointer;
  }
  .f-toggle.open { color: var(--red); }
  .filters { display: none; position: static; padding: .8rem; gap: .55rem; }
  .filters.open { display: flex; flex-direction: column; align-items: stretch; }
  .filters.open > * { width: 100%; }
  .filters.open .ms-btn { width: 100%; text-align: left; }
  .filters.open .ms-panel { position: static; width: 100%; box-shadow: none;
    border: 1px solid var(--line); margin-top: .3rem; }
  .filters.open .inline { justify-content: space-between; }
  .filters.open input[type=search],
  .filters.open input[type=number] { width: 100% !important; }
  .filters-spacer { display: none; }
  .view-toggle { display: none; }        /* mobile = toujours grille */
  #f-sort { flex: 1; min-width: 0; }

  /* --- Contenu : forcé en grille, petites vignettes (3 col ≈ téléphone) --- */
  .table-hint { display: none; }
  main { padding: 0 .5rem 5rem; }
  #games { display: none !important; }
  #grid {
    grid-template-columns: repeat(auto-fill, minmax(102px, 1fr));
    gap: .4rem; padding: .6rem 0 1rem;
  }
  .card { border-radius: 8px; }
  .card-title {
    font-size: .68rem; line-height: 1.15;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .card-body { padding: .35rem .4rem .4rem; gap: .2rem; }
  .card-meta { font-size: .6rem; gap: .15rem .3rem; }
  .card-sub { font-size: .58rem; }
  .card-play a { width: 1.5rem; height: 1.5rem; font-size: .7rem; }
  .card-sub .rarity { font-size: .52rem; padding: .05rem .25rem .05rem .2rem; }
  .card-sub .rarity .dot { width: 4px; height: 4px; }
  .card-phys select { font-size: .68rem; padding: .15rem .2rem; min-height: 32px; }
  .mp-btn { min-height: 32px; font-size: .62rem; padding: .15rem .3rem; }
  .mprice { font-size: .65rem; }

  /* --- Cibles tactiles (contrôles des filtres/pagination) --- */
  .ms-btn, #f-reset, #f-sort, #p-size, .pager button { min-height: 40px; }
  .ms-list label { padding: .5rem .3rem; }   /* cases plus faciles à toucher */

  /* --- Pagination --- */
  .pager { flex-wrap: wrap; gap: .4rem; padding: .5rem .6rem; }
  .pager button { padding: .5rem .7rem; }
  #p-info { flex-basis: 100%; text-align: center; order: -1; font-size: .8rem; }

  /* --- Pop-ups plein écran mobile --- */
  .cover-pop img { width: 60vw; }
  .video-modal { padding: .6rem; }
  .video-modal .vm-frame { width: 96vw; height: 54vw; }
  .video-modal .vm-close { top: .4rem; right: .6rem; }
  .price-modal { padding: .6rem; }
  .price-modal .pm-box { width: 96vw; max-height: 88vh; padding: 1rem; }
  .pm-row { grid-template-columns: 40px 1fr auto; }
  .pm-row .pm-plat { display: none; }
}

/* Écrans tactiles : pas d'aperçu au survol (déclenché par un tap fantôme) */
@media (hover: none) {
  #cover-pop, #video-pop { display: none !important; }
}

/* ============================================================
   PAGE D'ACCUEIL  (grille de consoles)
   ============================================================ */
.hub-sub { color: var(--muted); font-size: .85rem; }
.hub-back {
  font-size: .8rem; color: var(--muted); text-decoration: none;
  padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 6px;
  white-space: nowrap;
}
.hub-back:hover { border-color: var(--red); color: var(--text); }

.hub { padding: 2rem 1.5rem 4rem; }
.hub-grid {
  display: grid; gap: 1.4rem; max-width: 1100px; margin: 0 auto;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.hub-tile {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  text-decoration: none; color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
  transition: transform .13s ease, box-shadow .13s ease, border-color .13s ease;
}
.hub-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent, var(--red));
}
.hub-tile:focus-visible { outline: 3px solid var(--accent, var(--red)); outline-offset: 2px; }
.hub-art {
  display: grid; place-items: center; aspect-ratio: 16 / 10; overflow: hidden;
  background: linear-gradient(135deg, var(--accent, #444) 0%, var(--accent2, var(--accent, #222)) 100%);
}
.hub-art img { width: 62%; height: 62%; object-fit: contain; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .42)); }
/* Vignette qui apporte son propre fond + son ombre : elle remplit le panneau. */
.hub-art--fill img { width: 100%; height: 100%; object-fit: cover; filter: none; }
.hub-meta { padding: .95rem 1.1rem 1.05rem; }
.hub-name { display: block; font-weight: 700; font-size: 1.08rem; letter-spacing: -.01em; }
.hub-count { display: block; margin-top: .2rem; color: var(--muted); font-size: .85rem; }
.hub-tile.soon .hub-count { font-style: italic; }

@media (max-width: 760px) {
  .hub { padding: 1.2rem .8rem 3rem; }
  .hub-grid { gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .hub-meta { padding: .7rem .8rem .8rem; }
  .hub-name { font-size: .95rem; }
  .hub-count { font-size: .78rem; }
  .hub-back { padding: .35rem .5rem; font-size: .8rem; }
}

/* ---- Variantes physiques (Dreamcast : langues / EAN / codes SKU) ---- */
.variant-info { margin-top: .25rem; font-size: .78rem; }
.variant-head { color: var(--muted); font-variant-numeric: tabular-nums; }
.variant-info details { margin-top: .15rem; }
.variant-info summary {
  cursor: pointer; color: var(--muted); font-size: .74rem;
  text-transform: uppercase; letter-spacing: .03em; width: max-content;
}
.variant-codes {
  margin-top: .3rem; padding: .4rem .55rem; border: 1px solid var(--line);
  border-radius: 6px; background: var(--input-bg); max-width: 46rem;
}
.variant-codes > div {
  display: grid; grid-template-columns: 8.5rem 1fr; gap: .15rem .6rem;
  padding: .12rem 0;
}
.variant-codes > div + div { border-top: 1px dashed var(--line); }
.variant-codes span { color: var(--muted); }
.variant-codes code { font-size: .76rem; word-break: break-word; }
.variant-note { margin: .35rem 0 0; color: var(--muted); font-size: .74rem; }
#dedup-box .hint-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1rem; height: 1rem; padding: 0; font-size: .68rem; font-weight: 700;
  color: #fff; background: var(--muted); border-radius: 999px; cursor: help;
}
.card .variant-info { font-size: .72rem; }
.card .variant-codes { max-width: none; }

/* ---- Jaquette arrière Dreamcast — lien « (BACK) » (aperçu au survol) ---- */
.cover-back {
  font-size: .68rem; font-weight: 700; letter-spacing: .04em; color: var(--muted);
  cursor: help; user-select: none; white-space: nowrap;
}
.cover-back:hover { color: var(--text); }
.card-cover .card-back {
  position: absolute; top: 6px; right: 6px; padding: .1rem .3rem;
  background: rgba(0,0,0,.62); color: #fff; border-radius: 4px; font-size: .58rem;
  letter-spacing: .04em; cursor: help;
}
.card-cover .card-back:hover { background: rgba(0,0,0,.85); }

/* ---- Jaquette en plein écran au clic (résolution max) ---- */
.img-modal[hidden] { display: none !important; }
.img-modal {
  position: fixed; inset: 0; z-index: 100; display: flex;
  align-items: center; justify-content: center; padding: 2.5vmin;
  background: rgba(0, 0, 0, .88);
}
.img-modal #im-img {
  max-width: 96vw; max-height: 96vh; object-fit: contain;
  border-radius: 4px; box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
  opacity: 0; transition: opacity .15s;
}
.img-modal #im-img.ready { opacity: 1; }
.img-modal .im-spinner {
  position: absolute; color: #fff; font-size: .85rem; opacity: .8;
}
.im-close {
  position: absolute; top: 14px; right: 18px; width: 2.2rem; height: 2.2rem;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14);
  color: #fff; font-size: 1.1rem; cursor: pointer; line-height: 1;
}
.im-close:hover { background: rgba(255, 255, 255, .28); }

/* ---- Mega Drive : titre original + région/serial/éditions repliés sous le titre ---- */
.title-cell details.td-more,
.card-body details.td-more { margin-top: .2rem; }
details.td-more > summary {
  list-style: none; cursor: pointer; display: inline-block;
  color: var(--muted); font-size: .74rem; letter-spacing: .02em; user-select: none;
}
details.td-more > summary::-webkit-details-marker { display: none; }
details.td-more > summary::before { content: "\25B8\00A0"; }
details.td-more[open] > summary::before { content: "\25BE\00A0"; }
details.td-more > summary:hover { color: var(--text); }
details.td-more[open] > summary { margin-bottom: .2rem; }
