/* Jeux Multi — une étagère de jeux, calme : l'image de chaque jeu et trois
   chiffres colorés portent l'information, le texte reste au minimum. */
@font-face {
  font-family: "Outfit";
  src: url("/static/fonts/outfit-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0c0f1a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hi: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f1f3f9;
  --muted: #8d95ab;
  --faint: #5b6377;
  --accent: #8fb0ff;
  --accent-ink: #0b1020;
  --good: #6fdba8;
  --mid: #f2c66d;
  --bad: #f58a8a;
  --gold: #f2c66d;
  --good-soft: #9fc7b5;
  --mid-soft: #cfbf96;
  --bad-soft: #d3a4a4;
  --radius: 16px;
  --font: "Outfit", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh;
  background: radial-gradient(1100px 520px at 50% -180px, rgba(110, 140, 255, 0.16), transparent 70%) no-repeat, var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.2; }
h1 { font-size: 2rem; font-weight: 300; letter-spacing: -0.01em; margin-bottom: 1.25rem; }
.page > h2 { font-size: 1.25rem; margin: 2.5rem 0 0.9rem; }
p { margin: 0 0 0.75rem; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 0.875rem; font-weight: 400; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 60ch; }
code { font-family: ui-monospace, Consolas, monospace; }
.icon { width: 1.15em; height: 1.15em; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Barre du haut */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem;
  max-width: 1240px; margin: 0 auto; padding: 1.25rem clamp(1rem, 4vw, 2rem);
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); font-size: 1.3rem; font-weight: 500; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand .icon { width: 1.5rem; height: 1.5rem; color: var(--gold); }
.topnav { display: flex; align-items: center; gap: 1.1rem; }
.topnav > a:not(.btn) { color: var(--muted); }
.topnav > a:not(.btn):hover, .topnav > a[aria-current] { color: var(--text); text-decoration: none; }
.topnav form { margin: 0; display: flex; }

.page { max-width: 1000px; margin: 0 auto; padding: 1rem clamp(1rem, 4vw, 2rem) 5rem; }
.page-wide { max-width: 1240px; }
.page-narrow { max-width: 440px; padding-top: 3rem; }
.page-form { max-width: 640px; }

/* Messages */
.flash { padding: 0.7rem 1rem; border-radius: 12px; margin-bottom: 1rem; background: rgba(111, 219, 168, 0.12); color: #c9f3e0; }
.flash-error { background: rgba(245, 138, 138, 0.13); color: #ffd5d5; }
.flash-warn { background: rgba(242, 198, 109, 0.13); color: #fbe6b8; }
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 10;
  max-width: min(90vw, 520px); padding: 0.8rem 1.1rem; border-radius: 12px;
  background: #3a1d27; color: #ffd5d5; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* Boutons */
.btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font: 500 0.95rem/1.2 var(--font); cursor: pointer; color: var(--text);
  background: var(--surface-hi); border: 1px solid transparent; border-radius: 999px;
  padding: 0.6rem 1.15rem;
}
.btn:hover { background: rgba(255, 255, 255, 0.14); text-decoration: none; }
.btn-primary { background: var(--text); color: var(--accent-ink); }
.btn-primary:hover { background: #fff; }
.btn-small { padding: 0.35rem 0.8rem; font-size: 0.85rem; }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: rgba(245, 138, 138, 0.18); }
.iconbtn-done:hover { color: var(--gold); background: rgba(242, 198, 109, 0.14); }
.linklike { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; }
.iconbtn {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem; flex: none;
  border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; font-size: 1rem;
}
.iconbtn:hover { color: var(--text); background: var(--surface-hi); text-decoration: none; }

/* Formulaires */
.form { display: grid; gap: 1.1rem; margin-bottom: 1rem; }
.form label { display: block; font-weight: 500; font-size: 0.95rem; }
.form label .hint { margin-left: 0.4rem; }
.form label > input, .form label > textarea { display: block; margin-top: 0.4rem; }
.form input:not([type=checkbox]), .form textarea {
  font: 400 1rem var(--font); color: var(--text); background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.8rem; width: 100%;
}
.form input:focus, .form textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(143, 176, 255, 0.22); }
.form ::placeholder { color: var(--faint); }
.form > .btn { justify-self: start; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: end; }
.row-3 { grid-template-columns: repeat(3, 1fr); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem; margin: 0; display: grid; gap: 0.9rem; }
legend { font-weight: 500; padding: 0 0.5rem; color: var(--muted); font-size: 0.9rem; }
fieldset .hint { margin: 0; }
.links-box { background: var(--surface); }
.prefill { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; }
.checks { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.form .check { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 400; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.cover-preview { width: 64px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; display: block; }
.cover-preview[hidden] { display: none; }
.titlerow { display: flex; align-items: end; gap: 1rem; }
.titlerow label { flex: 1; }
.row-4 { grid-template-columns: repeat(4, 1fr); }
.row-5 { grid-template-columns: repeat(5, 1fr); gap: 0.75rem; }
.more { border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem 1rem; }
.more summary { cursor: pointer; color: var(--muted); font-size: 0.95rem; }
.more-body { display: grid; gap: 1rem; margin-top: 1rem; }
.igdb-results { list-style: none; margin: -0.5rem 0 0; padding: 0.35rem; display: grid; gap: 2px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); border-radius: 12px; }
#igdb-results:empty { display: none; }
.igdb-pick { display: flex; align-items: center; gap: 0.8rem; width: 100%; padding: 0.35rem 0.5rem; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.igdb-pick:hover, .igdb-pick:focus-visible { background: var(--surface-hi); }
.igdb-pick img, .igdb-nocover { width: 36px; height: 48px; object-fit: cover; border-radius: 4px; background: var(--surface-hi); flex: none; }
.igdb-name { flex: 1; }
.igdb-name small { color: var(--muted); margin-left: 0.3rem; }
.igdb-platforms { display: flex; gap: 0.25rem; }
.form-actions { display: flex; align-items: center; gap: 1.25rem; margin-top: 0.4rem; }
.form-inline { grid-template-columns: minmax(0, 280px) auto; align-items: end; justify-content: start; }
.danger { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 0.75rem; }
.danger form { margin: 0; }

/* Listes */
.board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem; align-items: start; }
.quiet { margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.tabs { display: flex; gap: 0.4rem; margin-bottom: 1.1rem; }
.tab { font: 400 1.05rem var(--font); color: var(--muted); background: none; border: 0; border-radius: 999px; padding: 0.4rem 1rem; cursor: pointer; display: inline-flex; align-items: baseline; gap: 0.5rem; }
.tab:hover { color: var(--text); }
.tab[aria-selected=true] { color: var(--text); background: var(--surface-hi); }
.tab .count { font-size: 0.85rem; color: var(--faint); }
.tabpanel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem 2.5rem; align-items: start; }
.tabpanel[hidden] { display: none; }
.tabpanel + .tabpanel:not([hidden]) { margin-top: 0.9rem; }
.list { display: grid; gap: 0.9rem; }
.list h2 { font-size: 1.6rem; font-weight: 300; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.35rem; }
.list .count { font-size: 1rem; color: var(--faint); }
.list-validated h2 { color: var(--gold); }
.empty { color: var(--faint); margin: 0; padding: 1.5rem 0; }
.empty-big { text-align: center; padding: 6rem 1rem; display: grid; gap: 1.25rem; justify-items: center; font-size: 1.2rem; color: var(--muted); }

/* Carte de jeu */
.card {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 1.1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.75rem; scroll-margin-top: 1.5rem;
}
.card.needs-vote { border-color: rgba(143, 176, 255, 0.55); background: rgba(143, 176, 255, 0.07); }
.card:target { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }
.cover { display: block; aspect-ratio: 3 / 4; align-self: start; border-radius: 10px; overflow: hidden; background: rgba(0, 0, 0, 0.35); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-empty { display: grid; place-items: center; height: 100%; font-size: 1.4rem; font-weight: 300; color: var(--faint); text-transform: uppercase; letter-spacing: 0.05em; }
.card-body { display: grid; gap: 0.55rem; align-content: start; min-width: 0; padding: 0.15rem 0.25rem 0.15rem 0; }
.card-head { display: flex; align-items: center; gap: 0.15rem; min-height: 2rem; }
.card-head h3 { font-size: 1.15rem; margin-right: 0.35rem; overflow-wrap: anywhere; }
.card-head h3 a { color: var(--text); }
.card-head h3 a:hover { color: var(--accent); text-decoration: none; }
.iconbtn-edit { margin-left: auto; opacity: 0; }
.card:hover .iconbtn-edit, .iconbtn-edit:focus-visible { opacity: 1; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1rem; list-style: none; margin: 0; padding: 0; color: var(--muted); font-size: 0.9rem; }
.metric { display: inline-flex; align-items: center; white-space: nowrap; }
.metric b { font-size: 1rem; font-weight: 500; color: #c9cfdd; }
.metric .icon { color: var(--faint); }
.metric .icon { margin-right: 0.4rem; }
/* Indication seulement : teintes douces, pour laisser les votes ressortir. */
.lvl-low b { color: var(--good-soft); }
.lvl-mid b { color: var(--mid-soft); }
.lvl-high b { color: var(--bad-soft); }
.platform { display: inline-block; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em; line-height: 1.5; padding: 0 0.4rem; border-radius: 4px; border: 1px solid transparent; }
.meta .platform { margin-right: -0.7rem; }
.meta .platform:last-of-type { margin-right: 0; }
.platform.ps3 { background: #000; color: #fff; border-color: rgba(255, 255, 255, 0.28); }
.platform.ps4 { background: #0a3a8f; color: #fff; }
.platform.ps5 { background: #fff; color: #0c0f1a; }
.when { margin-left: auto; color: var(--faint); }
.notes { margin: 0; color: var(--muted); font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.1rem; }
.card-foot form { margin: 0; }
.voters { display: flex; flex-wrap: wrap; gap: 0.3rem; list-style: none; margin: 0 auto 0 0; padding: 0; }
.voter { font-size: 0.8rem; font-weight: 500; padding: 0.15rem 0.6rem; border-radius: 999px; border: 1px solid transparent; }
.voter.is-yes { background: rgba(111, 219, 168, 0.16); color: var(--good); }
.voter.is-no { background: rgba(245, 138, 138, 0.16); color: var(--bad); }
.voter.is-maybe { background: var(--surface-hi); color: #c3c9d8; }
.voter.is-none { border: 1px dashed rgba(255, 255, 255, 0.18); color: var(--faint); }
.voter.me { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.votebox { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); }
.vote { display: inline-grid; place-items: center; width: 2.1rem; height: 1.9rem; border: 0; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; }
.vote-yes { --vote: var(--good); } .vote-maybe { --vote: #c3c9d8; } .vote-no { --vote: var(--bad); }
.vote:hover { color: var(--vote); background: var(--surface-hi); }
.vote[aria-pressed=true] { background: var(--vote); color: var(--accent-ink); }
.needs-vote .votebox { border-color: rgba(143, 176, 255, 0.7); }
.htmx-request .votebox { opacity: 0.5; }

/* Listes secondaires : terminés et archivés, en plus discret */
.quiet .card { grid-template-columns: 54px minmax(0, 1fr); gap: 0.9rem; padding: 0.55rem; background: none; }
.quiet .card-head h3 { font-size: 1rem; }
.quiet .cover img { filter: saturate(0.6); opacity: 0.8; }
.quiet .notes { display: none; }
.is-completed .card-head h3::after { content: ""; }

/* Admin */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 0.925rem; }
.table th, .table td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 500; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tr.inactive td { color: var(--faint); }
.actions { min-width: 260px; }
.actions form { display: inline-block; margin: 0 0.25rem 0.3rem 0; }
.pill { display: inline-block; white-space: nowrap; font-size: 0.8rem; padding: 0.1rem 0.6rem; border-radius: 999px; background: var(--surface-hi); margin: 0 0.2rem 0.2rem 0; }
.pill-admin { color: var(--gold); background: rgba(242, 198, 109, 0.14); }
.pill-off { color: var(--bad); background: rgba(245, 138, 138, 0.14); }
.temp { background: rgba(242, 198, 109, 0.1); border: 1px solid rgba(242, 198, 109, 0.4); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1.5rem; }
.temp code { font-size: 1.4rem; letter-spacing: 0.05em; margin-right: 0.75rem; user-select: all; }
.temp p:last-child { margin: 0; }
.facts { display: grid; gap: 0.5rem; margin: 0 0 1rem; }
.facts div { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

@media (max-width: 940px) {
  .board { grid-template-columns: 1fr; gap: 2.5rem; }
  .quiet { margin-top: 3rem; }
  .tabpanel { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .card { grid-template-columns: 76px minmax(0, 1fr); gap: 0.8rem; }
  .iconbtn-edit { opacity: 1; }
  .row, .row-3 { grid-template-columns: 1fr; }
  .row-4, .row-5 { grid-template-columns: 1fr 1fr; }
  .facts div { grid-template-columns: 1fr; gap: 0; }
  .form-inline { grid-template-columns: 1fr; }
  .topnav { gap: 0.8rem; width: 100%; justify-content: flex-end; }
}
@media (hover: none) { .iconbtn-edit { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .btn, .vote, .iconbtn, .card-head h3 a { transition: background-color 0.15s, color 0.15s, opacity 0.15s; }
}
