:root {
  --bg: #171E29;
  --panel: #212A38;
  --panel-2: #1B2330;
  --line: #36435A;
  --text: #E8EAEF;
  --muted: #9BA6B8;
  --ct: #7D9FD1;
  --sand: #E3B25C;
  --sand-ink: #2A1E08;
  --ban: #58C09A;
  --err: #E58A8A;
  --paper: #E4D2A6;
  --ink: #3A2413;
  --rust: #8E2A1B;
  --head: 'Barlow Condensed', 'Arial Narrow', Impact, sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--text); font: 400 1rem/1.5 var(--body); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--ct); }
main { width: 100%; max-width: 860px; margin: 0 auto; padding: 1rem 1rem 3rem; flex: 1; }
:focus-visible { outline: 2px solid var(--sand); outline-offset: 2px; }
h1, h2 { font-family: var(--head); font-weight: 700; line-height: 1.05; margin: 0 0 .5rem; }
h1 { font-size: clamp(2rem, 6vw, 3rem); max-width: 18ch; }
h2 { font-size: 1.5rem; }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.brand { font: 700 1.5rem/1 var(--head); color: var(--text); text-decoration: none; margin-right: auto; letter-spacing: .02em; }
.who-mail { color: var(--muted); font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }

.btn { font: 500 1rem/1 var(--body); border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: .7rem 1rem; border-radius: 6px; cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--ct); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--ct); border-color: var(--ct); color: #0F1722; font-weight: 600; }
.btn.ghost { background: transparent; padding: .5rem .75rem; font-size: .9rem; }
.btn[hidden] { display: none; }

#msg { margin: 0; min-height: 1.5rem; padding: .25rem 1rem; text-align: center; color: var(--sand); }

.intro { padding: 1.5rem 0 1rem; }
.lead { color: var(--muted); max-width: 52ch; margin: 0 0 1rem; }
.flag-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.flag-form input { flex: 1 1 18rem; }
input[type=text], input[type=search], input[type=email], input[type=password] {
  font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: .7rem .8rem; width: 100%;
}
input::placeholder { color: #75819A; }

.stats { display: flex; gap: 1.5rem; padding: 1rem 0; color: var(--muted); }
.stats strong { font: 700 1.75rem/1 var(--head); color: var(--text); margin-right: .35rem; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs a { padding: .6rem 1rem; text-decoration: none; color: var(--muted); font: 600 1.15rem/1 var(--head); border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; }
.tabs a[aria-current=page] { color: var(--text); background: var(--panel); border-color: var(--line); margin-bottom: -1px; }
.tabs a.wanted[aria-current=page] { color: var(--sand); }
.note { color: var(--muted); margin: 0 0 1rem; font-size: .95rem; }
.search { margin-bottom: 1rem; }

.list { display: grid; gap: .6rem; }
.dossier {
  position: relative; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: .9rem;
  padding: .8rem 1rem; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: 6px; text-decoration: none; color: var(--text); overflow: hidden;
}
.dossier:hover { border-color: var(--ct); }
.dossier.wanted { border-left-color: var(--sand); }
.dossier.banned { border-left-color: var(--ban); }
.dossier.banned .name { text-decoration: line-through; text-decoration-color: #ffffff55; color: var(--muted); }
.who { display: flex; flex-direction: column; min-width: 0; }
.name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sid { color: var(--muted); font-size: .8rem; }
.count { text-align: center; line-height: 1.1; }
.count strong { display: block; font: 700 1.6rem/1 var(--head); }
.count span { font-size: .75rem; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: .4rem; font: 600 .95rem/1 var(--head); padding: .35rem .6rem .35rem .5rem; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.suspected { color: var(--ct); border-color: #7D9FD166; }
.ico { width: 1.15em; height: 1.15em; flex: none; display: block; }
.badge.wanted { background: var(--sand); color: var(--sand-ink); border-color: var(--sand); letter-spacing: .04em; }

.avatar { width: 48px; height: 48px; border-radius: 6px; background: var(--line); object-fit: cover; display: grid; place-items: center; font: 700 1.4rem/1 var(--head); color: var(--muted); flex: none; }
.avatar.lg { width: 96px; height: 96px; font-size: 2.6rem; }

/* L'élément marquant : le tampon BANNI */
.stamp {
  font: 700 1.5rem/1 var(--head); letter-spacing: .12em; color: var(--ban);
  border: 3px solid var(--ban); border-radius: 4px; padding: .3rem .6rem;
  transform: rotate(-7deg); opacity: .92; white-space: nowrap;
}
.stamp.lg { font-size: 2.4rem; border-width: 4px; padding: .4rem .9rem; }

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

.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 1.25rem; }
.sheet-head { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.sheet-head .id { flex: 1 1 14rem; min-width: 0; }
.sheet-head h1 { font-size: 2.2rem; max-width: none; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; margin: 1.25rem 0; padding: 1rem 0; border-block: 1px solid var(--line); }
.facts div { display: flex; flex-direction: column; }
.facts dt { color: var(--muted); font-size: .85rem; }
.facts dd { margin: 0; font: 600 1.4rem/1.2 var(--head); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.back { display: inline-block; margin-bottom: 1rem; }
.muted { color: var(--muted); }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 1.5rem; width: min(24rem, 92vw); }
dialog::backdrop { background: #0009; }
dialog form, .authbox { display: grid; gap: .6rem; }
.divider { text-align: center; color: var(--muted); font-size: .85rem; }
.row { display: flex; gap: .5rem; }
.row .btn { flex: 1; }

.foot { border-top: 1px solid var(--line); padding: 1rem; color: var(--muted); font-size: .85rem; text-align: center; }
.foot p { margin: .25rem auto; max-width: 70ch; }
#dev { margin-top: .5rem; }
#dev input { width: 12rem; display: inline-block; padding: .3rem .5rem; }

a.btn { text-decoration: none; display: inline-block; }
.aka { margin: .1rem 0; }
.hint { color: var(--sand); font-size: .95rem; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; margin: .75rem 0 1rem; }
.shotbox { margin: 0; }
.shotbox figcaption { font-size: .8rem; color: var(--muted); margin-top: .25rem; overflow-wrap: anywhere; }
.shot { width: 100%; display: block; aspect-ratio: 16 / 10; object-fit: cover; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; }
.upload { display: grid; gap: .5rem; margin: .75rem 0 1rem; padding: .9rem; border: 1px dashed var(--line); border-radius: 6px; }
input[type=file] { color: var(--muted); font: inherit; }
.mine { margin: .5rem 0 1rem; padding-left: 1.1rem; color: var(--muted); font-size: .9rem; }
.pending { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: 1rem; margin-bottom: 1rem; align-items: start; }
.pending .shot { aspect-ratio: auto; max-height: 280px; object-fit: contain; }

textarea { font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: .7rem .8rem; width: 100%; resize: vertical; }
textarea::placeholder { color: #75819A; }
.flag-form textarea { flex: 1 1 100%; }
.actions-box { display: grid; gap: .5rem; margin-bottom: 1rem; }
.actions-box .btn { justify-self: start; }
.small { font-size: .8rem; margin: 0; }
.comments { list-style: none; margin: .5rem 0 1.25rem; padding: 0; display: grid; gap: .6rem; }
.comments li { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: .7rem .9rem; }
.comments p { margin: 0 0 .25rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.comments .btn { margin-top: .25rem; }

.author { display: inline-flex; align-items: center; gap: .35rem; vertical-align: middle; }
.author-name { color: var(--muted); }
.author.steam .author-name { color: var(--ct); }
.avatar.xs { width: 18px; height: 18px; border-radius: 50%; }
.tag-steam { font-size: .7rem; line-height: 1.4; padding: 0 .35rem; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); }

.who-mail a { color: var(--ct); text-decoration: none; }
.who-mail a:hover { text-decoration: underline; }
a.author-name { text-decoration: none; }
a.author-name:hover { text-decoration: underline; }
.flagrow { grid-template-columns: auto 1fr auto; }

.steam-btn {
  display: inline-flex; align-items: center; gap: .6rem; padding: .6rem 1.1rem;
  background: #2A6BAF; color: #fff; text-decoration: none; white-space: nowrap;
  font: 600 1rem/1 var(--body); border-radius: 6px; box-shadow: 0 1px 0 #0004;
}
.steam-btn:hover { background: #3480CF; }
.steam-btn img { width: 26px; height: 26px; flex: none; }
.steam-btn[hidden] { display: none; }

/* ── Rangs des membres ── */
.rank { --rc: var(--muted); display: inline-flex; align-items: center; gap: .4rem; font: 700 1rem/1 var(--head); padding: .3rem .6rem .3rem .45rem; border-radius: 4px; border: 1px solid var(--rc); color: var(--rc); white-space: nowrap; }
.rank.contributor { --rc: #9BA6B8; }
.rank.detective { --rc: var(--ct); }
.rank.columbo { --rc: #D9965E; }
.rank.savior { --rc: var(--ban); background: var(--ban); color: #0E2A20; }
.rank.savior .ico path:last-child { stroke: var(--ban); }
.rank.sm { font-size: .85rem; padding: .2rem .45rem .2rem .35rem; margin-left: .5rem; vertical-align: middle; }
.ladder { list-style: none; margin: .5rem 0 1.25rem; padding: 0; display: grid; gap: .5rem; }
.ladder li { display: grid; grid-template-columns: 11rem 1fr auto; align-items: center; gap: .75rem; padding: .6rem .8rem; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; opacity: .5; }
.ladder li.done { opacity: .85; }
.ladder li.current { opacity: 1; border-color: var(--sand); }
.ladder .rank { justify-self: start; margin: 0; }
.ladder-req { color: var(--muted); font-size: .9rem; }
.ladder-state { font: 600 .95rem/1 var(--head); color: var(--muted); }
.ladder li.current .ladder-state { color: var(--sand); }

/* ── Affiche WANTED sur la photo de profil ── */
.poster {
  position: relative; flex: none; width: 190px; padding: 1.1rem .9rem .85rem; text-align: center;
  background: var(--paper); color: var(--ink); transform: rotate(-2deg);
  box-shadow: inset 0 0 26px #7a572a80, 0 8px 20px #0009;
  outline: 2px solid var(--ink); outline-offset: -7px;
  animation: tack .45s cubic-bezier(.2, .9, .3, 1.2) both;
}
.poster::before {
  content: ''; position: absolute; top: 4px; left: 50%; width: 9px; height: 9px; margin-left: -4.5px;
  border-radius: 50%; background: #5b5f66; box-shadow: inset -1px -1px 2px #0008, 0 1px 2px #0006;
}
.poster-title { font: 400 2.1rem/1 'Rye', var(--head), serif; letter-spacing: .03em; margin-top: .45rem; }
.poster-photo { position: relative; margin: .55rem auto .5rem; border: 3px solid var(--ink); line-height: 0; background: #b9a06a; }
.poster-photo .avatar { width: 100%; height: auto; aspect-ratio: 1; border-radius: 0; font-size: 4rem; background: #b9a06a; color: var(--ink); filter: grayscale(1) sepia(.7) contrast(1.1) brightness(.95); mix-blend-mode: multiply; }
.poster.caught .poster-photo .avatar { filter: grayscale(1) contrast(1.05); }
.poster-sub { font: 700 1.05rem/1 var(--head); letter-spacing: .2em; }
.poster-reward { display: flex; align-items: baseline; justify-content: center; gap: .4rem; margin-top: .5rem; padding-top: .45rem; border-top: 2px solid var(--ink); }
.poster-reward strong { font: 700 2rem/1 var(--head); color: var(--rust); }
.poster-reward span { font: 700 1rem/1 var(--head); letter-spacing: .14em; text-transform: uppercase; }
.poster-stamp {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-14deg);
  font: 700 1.9rem/1 var(--head); letter-spacing: .1em; color: #17603F; border: 4px solid #17603F;
  padding: .25rem .5rem; background: #e4d2a6e6; line-height: 1;
}
.hole { position: absolute; width: 26px; height: 26px; transform: translate(-50%, -50%) rotate(var(--r, 0deg)); pointer-events: none; filter: drop-shadow(0 1px 0 #ffffff40); }
.hole.a { left: 29%; top: 36%; width: 32px; --r: 20deg; }
.hole.b { left: 71%; top: 47%; width: 38px; --r: 130deg; }
.hole.c { left: 45%; top: 63%; width: 30px; --r: 250deg; }
.btn.danger { border-color: var(--err); color: var(--err); }
.btn.danger:hover:not(:disabled) { background: #E58A8A22; border-color: var(--err); }
/* Fiche MOST WANTED : affiche à gauche, « dossier » à droite (nom, liens, chiffres clés) */
.sheet-head.wanted { align-items: flex-start; gap: 1.75rem; padding-bottom: 1.5rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.sheet-head.wanted .id { flex: 1 1 17rem; }
.sheet-head.wanted h1 { font-size: 2.6rem; margin-bottom: .25rem; }
.case-tag { display: inline-flex; align-items: center; gap: .45rem; margin: .2rem 0 .5rem; font: 700 1rem/1 var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--sand); }
.case-tag.closed { color: var(--ban); --rc: var(--panel); }
.facts.in-case { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; margin: 1.1rem 0 0; padding: 1.1rem 0 0; border-bottom: 0; }
@keyframes tack {
  from { opacity: 0; transform: translateY(-14px) rotate(-7deg) scale(1.04); }
  to { opacity: 1; transform: rotate(-2deg); }
}
@media (prefers-reduced-motion: reduce) { .poster { animation: none; } }

@media (max-width: 560px) {
  .sheet-head .poster { margin-inline: auto; }
  .sheet-head.wanted h1 { font-size: 2rem; }
  .upload { grid-template-columns: minmax(0, 1fr); }
  .ladder li { grid-template-columns: 1fr auto; }
  .ladder-req { grid-column: 1 / -1; order: 3; }
  .pending { grid-template-columns: 1fr; }
  .dossier { grid-template-columns: auto 1fr auto; }
  .dossier .badge, .dossier .stamp { grid-column: 2 / -1; justify-self: start; }
  .who-mail { max-width: 38vw; }
}

/* ── Jeu concerné, force du signal, avis, charte ── */
.game-chip { display: inline-flex; align-items: center; gap: .4rem; margin: .1rem 0 .55rem; padding: .3rem .6rem .3rem .45rem; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); color: var(--ct); font: 600 .95rem/1 var(--head); }
.signal { margin: .8rem 0 0; }
.signal-row { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .7rem; }
.signal-title { color: var(--muted); font-size: .9rem; }
.stars { display: inline-flex; gap: .15rem; color: var(--sand); }
.stars .ico { width: 1.3rem; height: 1.3rem; }
.stars .off { color: var(--line); }
.signal-label { font: 700 1.1rem/1 var(--head); letter-spacing: .03em; }
.signal-note { margin: .35rem 0 0; max-width: 46ch; color: var(--muted); font-size: .8rem; }
.notice { margin: 1rem 0; padding: .7rem .9rem; border: 1px dashed var(--line); border-radius: 6px; color: var(--muted); font-size: .9rem; }
.consent { display: flex; align-items: flex-start; gap: .55rem; flex: 1 1 100%; color: var(--muted); font-size: .9rem; line-height: 1.35; cursor: pointer; }
.consent input { flex: none; width: 1.05rem; height: 1.05rem; margin-top: .15rem; accent-color: var(--ct); }
.legal .sheet-head, .legal h1 { max-width: none; }
.legal-sec h2 { margin-top: 1.5rem; }
.legal-sec p { max-width: 68ch; margin: 0 0 .6rem; }
.poster-game { margin-top: .3rem; font: 700 .68rem/1.1 var(--head); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; opacity: .85; }
