/* =====================================================================
   Style général du site — thème bleu et noir.
   Les couleurs sont toutes ici : change-les pour modifier tout le site.
   (Les animations sont à part, dans /assets/animations/.)
   ===================================================================== */
:root {
  --bg: #05070d;             /* fond de page */
  --bg-2: #0a0f1c;           /* fond secondaire */
  --surface: #0f1626;        /* cartes, panneaux */
  --surface-2: #152036;      /* éléments au-dessus des cartes */
  --border: #1d2943;
  --border-strong: #2a3a5e;
  --text: #e8eef9;
  --muted: #8e9bb5;
  --blue: #3b82f6;           /* couleur principale */
  --blue-bright: #60a5fa;
  --blue-deep: #1e40af;
  --blue-glow: rgba(59, 130, 246, 0.35);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-width: 1180px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--blue-bright); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 16px; }
main.container { flex: 1; padding-top: 28px; padding-bottom: 48px; position: relative; z-index: 1; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5, 7, 13, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); font-size: 1.05rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 32px; height: 32px; }
.brand .beta { font-size: .65rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--blue); color: #fff; letter-spacing: .05em; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--muted); padding: 8px 12px; border-radius: var(--radius-sm); font-weight: 600; font-size: .93rem;
  position: relative; display: inline-flex; align-items: center; gap: 6px;
}
.nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav .badge { position: static; }
.user-chip { display: flex; align-items: center; gap: 8px; margin-left: 8px; padding-left: 12px; border-left: 1px solid var(--border); }
.user-chip .name { font-weight: 700; font-size: .92rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.menu-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border); color: var(--text); border-radius: var(--radius-sm); padding: 8px 10px; cursor: pointer; }
.menu-toggle svg { display: block; }

@media (max-width: 820px) {
  .menu-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 10px 16px 16px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
  .user-chip { margin: 8px 0 0; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--border); justify-content: space-between; }
}

.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 99px; background: var(--blue); color: #fff; font-size: .72rem; font-weight: 800;
}

/* ---------- Boutons et formulaires ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: .93rem;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--blue); color: #fff; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--blue-bright); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; border-color: rgba(239, 68, 68, .5); color: #fca5a5; }
.btn-danger:hover { background: rgba(239, 68, 68, .15); }
.btn-success { background: var(--success); color: #04120a; }
.btn-success:hover { background: #4ade80; }
.btn-sm { padding: 6px 12px; font-size: .84rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 5px; }
input[type="text"], input[type="password"], input[type="number"], textarea, select {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 11px 13px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-glow); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
textarea { resize: vertical; min-height: 90px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input { flex: 1 1 200px; width: auto; }
.form-error { color: #fca5a5; background: rgba(239, 68, 68, .1); border: 1px solid rgba(239, 68, 68, .35); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .9rem; margin-bottom: 14px; }
.form-ok { color: #86efac; background: rgba(34, 197, 94, .1); border: 1px solid rgba(34, 197, 94, .35); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .9rem; margin-bottom: 14px; }

/* ---------- Panneaux / cartes ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.panel + .panel { margin-top: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.page-head { margin-bottom: 26px; }
.page-head p { color: var(--muted); max-width: 640px; }
.empty { color: var(--muted); text-align: center; padding: 24px 8px; font-size: .95rem; }

/* ---------- Pages connexion / inscription ---------- */
.auth-wrap { max-width: 420px; margin: 4vh auto 0; }
.auth-wrap .panel { padding: 28px; }
.auth-wrap h1 { font-size: 1.6rem; text-align: center; }
.auth-wrap .sub { text-align: center; color: var(--muted); margin-bottom: 22px; }
.auth-logo { width: 64px; height: 64px; margin: 0 auto 14px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--muted); font-size: .92rem; }
.tip { font-size: .85rem; color: var(--muted); background: var(--bg-2); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 18px; }

/* ---------- Accueil ---------- */
.home-layout { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; }
@media (max-width: 980px) { .home-layout { grid-template-columns: 1fr; } }
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: radial-gradient(120% 140% at 0% 0%, rgba(59,130,246,.28), transparent 55%), linear-gradient(135deg, #0c1428, #05070d);
  padding: 30px 26px; margin-bottom: 28px;
}
.hero h1 { margin-bottom: 6px; }
.hero p { color: var(--muted); margin: 0; max-width: 560px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 1.15rem; }

.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.game-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.game-cover { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #0d1b3a, #05070d); }
.game-cover img { width: 100%; height: 100%; object-fit: cover; }
.game-card.is-soon .game-cover img { filter: grayscale(.35) brightness(.75); }
/* Bande-annonce : boucle muette par-dessus l'image, bouton pour la version complète */
.game-cover .cover-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.btn-trailer { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .78rem; font-weight: 800;
  color: #fff; background: rgba(5,7,13,.78); border: 1px solid var(--border-strong); border-radius: 99px; padding: 6px 12px; cursor: pointer; }
.btn-trailer:hover, .btn-trailer:focus-visible { border-color: var(--blue); }
dialog.dialog-video { width: min(960px, calc(100vw - 32px)); }
dialog.dialog-video .trailer-video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-sm); }
.status { position: absolute; top: 10px; left: 10px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 4px 9px; border-radius: 99px; background: rgba(5,7,13,.8); border: 1px solid var(--border-strong); }
.status-bientot { color: var(--blue-bright); }
.status-beta { color: #fde68a; border-color: rgba(245,158,11,.5); }
.status-disponible { color: #86efac; border-color: rgba(34,197,94,.5); }
.status-maintenance { color: #fca5a5; }
.game-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.game-body h3 { margin: 0; font-size: 1.12rem; }
.game-body p { margin: 0; color: var(--muted); font-size: .92rem; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .72rem; color: var(--muted); background: var(--bg-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 99px; }

/* ---------- Amis ---------- */
.friend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.friend {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.avatar {
  position: relative; flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; color: #fff; font-size: .95rem;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
}
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bg-2); background: #4b5568; }
.avatar .dot.online { background: var(--success); }
.avatar .dot.playing { background: var(--blue-bright); }
.friend-info { flex: 1; min-width: 90px; }
/* Dans les colonnes étroites (demandes d'amis), les boutons passent sous le pseudo. */
aside .friend { flex-wrap: wrap; }
aside .friend-actions { width: 100%; justify-content: flex-start; padding-left: 50px; }
.friend-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-status { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-status.playing { color: var(--blue-bright); }
.friend-status.online { color: #86efac; }
.friend-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) {
  .friend { flex-wrap: wrap; }
  .friend-actions { width: 100%; justify-content: flex-start; padding-left: 50px; }
}
.friends-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .friends-layout { grid-template-columns: 1fr; } }
.friends-side .friend { padding: 8px 10px; }
.friends-side .avatar { width: 32px; height: 32px; font-size: .85rem; }

.menu-pop { position: relative; display: inline-block; }
.menu-pop .menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 200px;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 6px; box-shadow: var(--shadow);
}
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); font: inherit; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.menu button:hover { background: var(--surface); }

/* ---------- Suggestions & feuille de route ---------- */
.roadmap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 34px; }
@media (max-width: 860px) { .roadmap { grid-template-columns: 1fr; } }
.roadmap-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.roadmap-col h3 { display: flex; align-items: center; gap: 8px; font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 12px; }
.roadmap-col h3 .pill { width: 10px; height: 10px; border-radius: 50%; }
.col-en_cours .pill { background: var(--blue-bright); }
.col-prochainement .pill { background: var(--warning); }
.col-termine .pill { background: var(--success); }
.roadmap-item { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.roadmap-item:last-child { margin-bottom: 0; }
.roadmap-item strong { display: block; }
.roadmap-item p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; white-space: pre-line; }

.suggestions-layout { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .suggestions-layout { grid-template-columns: 1fr; } .suggestions-layout aside { order: -1; } }
.suggestion { display: flex; gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; }
.vote-btn {
  flex: none; width: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  color: var(--text); font: inherit; font-weight: 800; cursor: pointer; padding: 8px 0;
}
.vote-btn svg { width: 16px; height: 16px; }
.vote-btn:hover { border-color: var(--blue); }
.vote-btn.voted { background: var(--blue); border-color: var(--blue); }
.vote-btn:disabled { cursor: default; opacity: .7; }
.suggestion-body { flex: 1; min-width: 0; }
.suggestion-body h3 { margin: 0 0 4px; overflow-wrap: anywhere; }
.suggestion-body p { margin: 0 0 6px; color: var(--muted); font-size: .92rem; white-space: pre-line; overflow-wrap: anywhere; }
.meta { font-size: .8rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.label { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--border-strong); }
.label-planifiee { color: #fde68a; border-color: rgba(245,158,11,.5); }
.label-refusee { color: #fca5a5; border-color: rgba(239,68,68,.5); }
.label-masquee { color: var(--muted); }
.label-ouverte { color: var(--blue-bright); }
.counter { font-size: .78rem; color: var(--muted); text-align: right; margin-top: 4px; }

/* ---------- Admin ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted);
  font: inherit; font-weight: 700; padding: 10px 14px; cursor: pointer; margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--blue); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat .n { font-size: 2rem; font-weight: 800; color: var(--blue-bright); }
.stat .l { color: var(--muted); font-size: .88rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--bg-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td .btn-row { flex-wrap: nowrap; }
code, .code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--bg-2); border: 1px solid var(--border); padding: 2px 7px; border-radius: 6px; font-size: .9em; letter-spacing: .04em; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.grid-form .field { margin: 0; }
.admin-roadmap .roadmap-item { display: flex; gap: 10px; align-items: flex-start; }
.admin-roadmap .roadmap-item > div:first-child { flex: 1; min-width: 0; }
.icon-btns { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 120px; }
.icon-btn { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; width: 30px; height: 30px; cursor: pointer; font: inherit; font-size: .9rem; display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--blue); }
.icon-btn.danger:hover { border-color: var(--danger); color: #fca5a5; }

/* ---------- Fenêtre (dialog) ---------- */
dialog {
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 22px; width: min(480px, calc(100vw - 32px)); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0, 0, 0, .65); }
dialog h2 { margin-bottom: 12px; }
dialog .btn-row { justify-content: flex-end; margin-top: 18px; }

/* ---------- Notifications ---------- */
.toasts { position: fixed; z-index: 100; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.toast {
  background: var(--surface-2); border: 1px solid var(--border-strong); border-left: 4px solid var(--blue);
  border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow); font-size: .92rem;
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
.toast .btn-row { margin-top: 10px; }

/* ---------- Pied de page ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 18px 0; color: var(--muted); font-size: .82rem; position: relative; z-index: 1; }
.site-footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.center-page { text-align: center; margin-top: 10vh; }
.center-page .big { font-size: 5rem; font-weight: 900; color: var(--blue); line-height: 1; }

/* ---------- Petites classes utilitaires ---------- */
.mt-8 { margin-top: 8px; margin-bottom: 0; }
.mt-20 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; }
main.container.narrow { max-width: 600px; }
.search-input { max-width: 240px; }
