/* ============ Twixt ============ */
:root {
  --bg: #0b0d12;
  --bg-elev: #12151c;
  --bg-hover: #161a23;
  --bg-input: #171b24;
  --border: #232836;
  --text: #e8eaf0;
  --muted: #8a92a6;
  --accent: #7c6cff;
  --accent-hover: #6a58ff;
  --accent-soft: rgba(124, 108, 255, .14);
  --like: #f43f6e;
  --like-soft: rgba(244, 63, 110, .12);
  --repost: #10b981;
  --repost-soft: rgba(16, 185, 129, .12);
  --danger: #ef4444;
  --success: #10b981;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #ffffff; --bg-elev: #f7f8fa; --bg-hover: #f2f3f6; --bg-input: #eff1f5; --border: #e4e7ee;
  --text: #0f1419; --muted: #5b6475; --accent-soft: rgba(124, 108, 255, .12); --shadow: 0 10px 40px rgba(15, 20, 25, .15);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.pad { padding: 12px 16px; }
[hidden] { display: none !important; }

.icon { width: 22px; height: 22px; flex: none; }

/* ---------- Shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 600px) 350px;
  justify-content: center;
  min-height: 100vh;
}
.sidenav {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 16px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 16px; padding: 11px 14px; border-radius: 999px;
  font-size: 18px; width: fit-content; transition: background .15s;
}
.nav-item:hover { background: var(--bg-hover); text-decoration: none; }
.nav-item.active { font-weight: 700; }
.nav-item.active .icon { stroke-width: 2.6; }
.nav-icon { position: relative; display: inline-flex; }
.dot {
  position: absolute; top: -6px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--bg);
}
.compose-btn { margin-top: 12px; width: 100%; }
.compose-icon { display: none; }

.me-menu { margin-top: auto; position: relative; }
.me-menu > summary {
  list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 999px; cursor: pointer;
}
.me-menu > summary::-webkit-details-marker { display: none; }
.me-menu > summary:hover { background: var(--bg-hover); }
.me-names { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.me-names strong, .me-names small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-names small { color: var(--muted); }
.me-menu .menu-pop { bottom: calc(100% + 6px); top: auto; left: 0; right: auto; min-width: 250px; }

.main { border-left: 1px solid var(--border); border-right: 1px solid var(--border); min-width: 0; min-height: 100vh; padding-bottom: 80px; }
.aside { padding: 10px 0 24px 28px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: none; }
.foot { color: var(--muted); font-size: 12px; padding: 0 16px; }

/* ---------- Têtes de page ---------- */
.page-head {
  display: flex; align-items: center; gap: 18px; padding: 10px 16px; min-height: 54px;
  flex-wrap: wrap;
}
.sticky { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.page-head .tabs { flex-basis: 100%; margin: 0 -16px -10px; border-bottom: 0; }
.page-title { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.page-title .icon { width: 20px; height: 20px; }
.section { border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.section-title { font-size: 19px; font-weight: 800; padding: 14px 16px 8px; }
.section-title.flush { padding: 0; }

.tabs { display: flex; border-bottom: 1px solid var(--border); }
.tab {
  flex: 1; text-align: center; padding: 15px 8px; color: var(--muted); font-weight: 600; position: relative;
}
.tab:hover { background: var(--bg-hover); text-decoration: none; }
.tab.active { color: var(--text); font-weight: 700; }
.tab.active::after { content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 56px; height: 4px; border-radius: 4px; background: var(--accent); }
.subtabs { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px; padding: 8px 18px; font-weight: 700; cursor: pointer;
  background: var(--bg-elev); white-space: nowrap; transition: background .15s, opacity .15s, border-color .15s;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn .icon { width: 18px; height: 18px; }
.btn-lg { padding: 14px 24px; font-size: 17px; }
.btn-sm { padding: 6px 14px; font-size: 14px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:not(:disabled):hover { background: var(--accent-hover); }
.btn-light { background: var(--text); color: var(--bg); }
.btn-light:hover { opacity: .88; }
.btn-outline { background: transparent; border-color: var(--border); }
.btn-outline:hover { background: var(--bg-hover); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-steam { background: #171a21; color: #fff; border-color: #2a475e; }
.btn-steam:hover { background: #1b2838; }
.btn[data-following="1"]:hover { border-color: var(--danger); color: var(--danger); background: rgba(239, 68, 68, .08); }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px;
  background: transparent; border: 0; cursor: pointer; color: inherit; flex: none; list-style: none;
}
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn:hover { background: var(--bg-hover); text-decoration: none; }
.icon-btn .icon { width: 20px; height: 20px; }
.icon-btn.accent { color: var(--accent); }
.icon-btn.accent:hover { background: var(--accent-soft); }
.icon-btn.bordered { border: 1px solid var(--border); }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px;
  background: var(--bg-hover); font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--border);
}
a.chip:hover { text-decoration: none; color: var(--text); }
.chip-active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip-vip { background: rgba(16, 185, 129, .14); color: #10b981; border-color: transparent; }
.chip-premium { background: rgba(234, 179, 8, .16); color: #d6a50a; border-color: transparent; }
.chip-staff { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip-admin { background: rgba(239, 68, 68, .14); color: #ef4444; border-color: transparent; }
.chip-danger { background: rgba(239, 68, 68, .14); color: #ef4444; border-color: transparent; }

/* ---------- Avatars & badges ---------- */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; flex: none; background: var(--bg-hover); overflow: hidden; }
.avatar-letter { background: hsl(var(--h) 55% 45%); color: #fff; font-weight: 700; }
.avatar-xs { width: 20px; height: 20px; font-size: 10px; }
.avatar-sm { width: 32px; height: 32px; font-size: 14px; }
.avatar-md { width: 42px; height: 42px; font-size: 18px; }
.avatar-lg { width: 72px; height: 72px; font-size: 30px; }
.avatar-xl { width: 134px; height: 134px; font-size: 54px; border: 4px solid var(--bg); }
.badge { width: 18px; height: 18px; vertical-align: -3px; margin-left: 3px; flex: none; }

/* ---------- Composer ---------- */
.composer-inline { border-bottom: 1px solid var(--border); padding: 12px 16px; }
.composer-grid { display: grid; grid-template-columns: 42px 1fr; gap: 12px; }
.composer-main { min-width: 0; }
.composer textarea {
  width: 100%; border: 0; outline: 0; resize: none; background: transparent; color: var(--text);
  font: inherit; font-size: 19px; padding: 8px 0; min-height: 52px;
}
.composer-bar { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
.counter { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.warn { color: #f59e0b; }
.counter.over { color: var(--danger); font-weight: 700; }
.composer-previews { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 6px 0; }
.composer-previews:empty { display: none; }
.preview { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 16/10; background: var(--bg-hover); }
.preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview button { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; display: grid; place-items: center; }
.preview button .icon { width: 16px; height: 16px; }
.composer-quote, .compose-context { border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; margin: 6px 0; font-size: 14px; }
.compose-context { margin: 0 16px 4px; border: 0; padding: 0 0 0 54px; color: var(--muted); }

/* ---------- Posts ---------- */
.feed { display: flex; flex-direction: column; }
.post { border-bottom: 1px solid var(--border); padding: 12px 16px; transition: background .15s; }
.post[data-href] { cursor: pointer; }
.post[data-href]:hover { background: color-mix(in srgb, var(--bg-hover) 60%, transparent); }
.post-hidden { opacity: .6; }
.post-context { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; margin: -2px 0 4px 30px; }
.post-context .icon { width: 15px; height: 15px; }
.staff-note { color: #f59e0b; }
.post-grid { display: grid; grid-template-columns: 42px 1fr; gap: 12px; }
.post-avatar { display: block; height: fit-content; }
.post-main { min-width: 0; }
.post-head { display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; }
.post-author { display: inline-flex; align-items: center; min-width: 0; }
.post-author strong { overflow: hidden; text-overflow: ellipsis; }
.post-head .handle { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.post-time { flex: none; }
.post-menu { margin-left: auto; position: relative; }
.post-menu > summary { width: 32px; height: 32px; margin: -6px -8px -6px 0; color: var(--muted); }
.post-menu > summary:hover { color: var(--accent); background: var(--accent-soft); }
.reply-to { font-size: 14px; }
.reply-to a { color: var(--accent); }
.post-body { white-space: normal; overflow-wrap: anywhere; margin-top: 2px; }
.post-body a, .profile-bio a, .bubble-body a { color: var(--accent); }
.post-detail .post-body { font-size: 18px; margin-top: 10px; }
.post-detail { cursor: default; }
.post-meta { padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.post-stats { display: flex; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.post-stats strong { color: var(--text); }
.post-thread { border-bottom: 0; }
.thread .post { position: relative; }
.thread .post-avatar { position: relative; }
.thread .post-avatar::after { content: ""; position: absolute; left: 50%; top: 46px; bottom: -40px; width: 2px; transform: translateX(-50%); background: var(--border); }
.post-missing { padding: 14px 16px; color: var(--muted); border-bottom: 1px solid var(--border); font-style: italic; }

.media-grid { display: grid; gap: 2px; margin-top: 10px; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); }
.media-grid a, .media-grid img { display: block; width: 100%; height: 100%; }
.media-grid img { object-fit: cover; background: var(--bg-hover); }
.media-1 img { max-height: 520px; height: auto; }
.media-2 { grid-template-columns: 1fr 1fr; aspect-ratio: 16/9; }
.media-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16/9; }
.media-3 > :first-child { grid-row: span 2; }
.media-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16/9; }
.media-2 a, .media-3 a, .media-4 a { min-height: 0; overflow: hidden; }
.media-small { aspect-ratio: auto; max-height: 160px; }

.quote { display: block; margin-top: 10px; border: 1px solid var(--border); border-radius: 16px; padding: 10px 12px; }
.quote:hover { background: var(--bg-hover); text-decoration: none; }
.quote .post-head { gap: 6px; }
.quote-missing { color: var(--muted); font-size: 14px; }

.post-actions { display: flex; justify-content: space-between; max-width: 420px; margin: 6px 0 -4px -8px; }
.post-detail .post-actions { max-width: none; justify-content: space-around; padding: 4px 0; border-bottom: 1px solid var(--border); margin: 0; }
.act {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 999px;
  background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; list-style: none; min-width: 54px;
}
.act::-webkit-details-marker { display: none; }
.act .icon { width: 19px; height: 19px; }
.act:disabled, .act[data-disabled] { opacity: .5; pointer-events: none; }
.act-reply:hover { color: var(--accent); }
.act-reply:hover .icon { background: var(--accent-soft); }
.act-repost:hover, .act-repost.on { color: var(--repost); }
.act-like:hover, .act-like.on { color: var(--like); }
.act-like.on .icon { fill: var(--like); }
.act .icon { border-radius: 50%; padding: 0; box-sizing: content-box; }
.act-like.pop .icon { animation: pop .35s ease; }
@keyframes pop { 40% { transform: scale(1.35); } }
.act-wrap { position: relative; }

/* ---------- Menus ---------- */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 50; min-width: 220px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
  padding: 6px 0; display: flex; flex-direction: column;
}
.act-wrap .menu-pop { left: 0; right: auto; }
.menu-pop > a, .menu-pop > button, .menu-pop form > button {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: transparent; border: 0;
  text-align: left; width: 100%; cursor: pointer; font-weight: 600; font-size: 15px; white-space: nowrap;
}
.menu-pop > a:hover, .menu-pop > button:hover, .menu-pop form > button:hover { background: var(--bg-hover); text-decoration: none; }
.menu-pop .icon { width: 18px; height: 18px; }
.menu-pop .danger { color: var(--danger); }

/* ---------- Cartes / sidebar ---------- */
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card-title { font-size: 19px; font-weight: 800; padding: 12px 16px; }
.trend { display: flex; flex-direction: column; padding: 10px 16px; line-height: 1.3; }
.trend:hover { background: var(--bg-hover); text-decoration: none; }
.trend small { color: var(--muted); font-size: 13px; }
.trend-row { border-bottom: 1px solid var(--border); }
.search {
  display: flex; align-items: center; gap: 10px; background: var(--bg-input); border: 1px solid transparent;
  border-radius: 999px; padding: 0 16px; color: var(--muted);
}
.search:focus-within { border-color: var(--accent); background: var(--bg); color: var(--accent); }
.search .icon { width: 18px; height: 18px; }
.search input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--text); font: inherit; padding: 11px 0; min-width: 0; }
.aside .search { position: sticky; top: 0; z-index: 5; box-shadow: 0 -10px 0 10px var(--bg); }
.search-wide { flex: 1; }

.account-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.account-row:hover { background: var(--bg-hover); }
.account-names { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.account-names:hover { text-decoration: none; }
.account-names strong, .account-names small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-bio { font-size: 14px; margin-top: 2px; color: var(--text); }
.list { display: flex; flex-direction: column; }

.empty { padding: 40px 24px; text-align: center; color: var(--text); }
.empty a { color: var(--accent); }
.big-status { font-size: 64px; font-weight: 900; color: var(--accent); }
.empty .btn { margin-top: 16px; }
.pager { display: flex; justify-content: center; gap: 10px; padding: 18px; }

/* ---------- Profil ---------- */
.banner { aspect-ratio: 3/1; background: linear-gradient(135deg, #2a2463, #5b45f5 60%, #9b8cff); background-size: cover; background-position: center; }
.profile-top { display: flex; justify-content: space-between; align-items: flex-start; padding: 12px 16px 0; }
.profile-avatar { margin-top: -82px; position: relative; }
.profile-actions { display: flex; gap: 8px; align-items: center; }
.profile-actions .post-menu > summary { margin: 0; width: 38px; height: 38px; color: var(--text); }
.profile-info { padding: 10px 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.profile-info > .muted { margin-top: -10px; }
.profile-name { font-size: 21px; font-weight: 800; display: flex; align-items: center; }
.profile-name .badge { width: 22px; height: 22px; }
.profile-bio { overflow-wrap: anywhere; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.profile-meta span { display: inline-flex; align-items: center; gap: 4px; }
.profile-meta .icon { width: 17px; height: 17px; }
.profile-meta a { color: var(--accent); }
.profile-follow { display: flex; gap: 18px; font-size: 14px; }

/* ---------- Notifications ---------- */
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif:hover { background: var(--bg-hover); text-decoration: none; }
.notif.unread, .notif-wrap.unread { background: var(--accent-soft); }
.notif-icon { width: 42px; display: flex; justify-content: flex-end; flex: none; }
.notif-icon .icon { width: 28px; height: 28px; }
.notif-like .icon { color: var(--like); fill: var(--like); }
.notif-repost .icon { color: var(--repost); }
.notif-follow .icon { color: var(--accent); fill: var(--accent); }
.notif-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.notif-avatars { display: flex; gap: 4px; }
.notif-excerpt { font-size: 14px; }
.notif-label { display: flex; align-items: center; gap: 6px; padding: 10px 16px 0 70px; font-size: 13px; }
.notif-label .icon { width: 16px; height: 16px; }
.notif-wrap .post { border-bottom: 0; }
.notif-wrap { border-bottom: 1px solid var(--border); }

/* ---------- Messages ---------- */
.dm { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.dm-open .dm-list { display: none; }
.dm:not(.dm-open) .dm-thread { display: none; }
.dm-new { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.dm-new input { flex: 1; }
.dm-item { display: flex; gap: 12px; padding: 12px 16px; align-items: center; border-bottom: 1px solid var(--border); }
.dm-item:hover { background: var(--bg-hover); text-decoration: none; }
.dm-item.active { background: var(--bg-hover); box-shadow: inset -3px 0 0 var(--accent); }
.dm-item.unread .dm-last { color: var(--text); font-weight: 600; }
.dm-item-main { min-width: 0; flex: 1; }
.dm-item-main > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }
.dm-thread { display: flex; flex-direction: column; height: 100vh; position: sticky; top: 0; }
.dm-peer { display: flex; align-items: center; gap: 10px; }
.dm-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.dm-date { align-self: center; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
.bubble { max-width: 75%; align-self: flex-start; display: flex; flex-direction: column; }
.bubble-body { background: var(--bg-hover); padding: 9px 14px; border-radius: 20px 20px 20px 6px; overflow-wrap: anywhere; }
.bubble.mine { align-self: flex-end; align-items: flex-end; }
.bubble.mine .bubble-body { background: var(--accent); color: #fff; border-radius: 20px 20px 6px 20px; }
.bubble.mine .bubble-body a { color: #fff; text-decoration: underline; }
.bubble time { font-size: 11px; color: var(--muted); margin: 2px 6px 0; }
.bubble.pending { opacity: .6; }
.dm-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--bg); }
.dm-compose textarea { flex: 1; resize: none; max-height: 140px; border-radius: 20px; }
.dm-closed { padding: 16px; text-align: center; border-top: 1px solid var(--border); }
.dm-placeholder { margin: auto; padding: 40px; text-align: center; }
.dm-placeholder h2 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }

/* ---------- Formulaires ---------- */
input[type=text], input[type=search], input:not([type]), textarea, select {
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text); border-radius: 10px;
  padding: 10px 12px; font: inherit; outline: 0; width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
.composer textarea:focus { border: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: 14px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 16px; }
.form-body { display: flex; flex-direction: column; gap: 16px; padding: 16px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.settings-form { gap: 0; }
.banner-edit, .avatar-edit { position: relative; }
.upload-overlay {
  position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.35); color: #fff; cursor: pointer;
  opacity: .85; transition: opacity .15s;
}
.upload-overlay:hover { opacity: 1; background: rgba(0,0,0,.5); }
.upload-overlay.round { border-radius: 50%; inset: 4px; }

.alert { padding: 12px 16px; border-radius: 12px; margin: 12px 16px; font-size: 14px; }
.alert-error { background: rgba(239, 68, 68, .12); color: #f87171; border: 1px solid rgba(239, 68, 68, .3); }
.profile-info .alert, .admin-account .alert { margin: 0; }

/* ---------- Modales ---------- */
.modal {
  border: 0; padding: 0; border-radius: 18px; background: var(--bg); color: var(--text);
  width: min(600px, calc(100vw - 24px)); box-shadow: var(--shadow); margin-top: 6vh;
}
.modal::backdrop { background: rgba(91, 112, 131, .4); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 8px 12px; }
.modal-title { font-size: 17px; }
.modal .composer { padding: 0 16px 14px; }
.modal-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.lightbox { background: rgba(0,0,0,.9); max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; border-radius: 0; display: grid; place-items: center; }
.lightbox img { max-width: 96vw; max-height: 92vh; object-fit: contain; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--accent); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 600; animation: toast-in .25s ease; max-width: 90vw; }
.toast-error { background: var(--danger); }
.toast.out { opacity: 0; transform: translateY(10px); transition: all .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Pages "gate" (connexion, slots) ---------- */
.bare { min-height: 100vh; }
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: min(460px, 100%); background: var(--bg-elev); border: 1px solid var(--border); border-radius: 22px; padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.gate-wide { width: min(820px, 100%); }
.gate-card.center { align-items: center; text-align: center; }
.gate-card h1 { font-size: 24px; font-weight: 800; }
.gate-head { display: flex; gap: 14px; align-items: center; }
.gate-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.slot { position: relative; border: 1px solid var(--border); border-radius: 18px; background: var(--bg); min-height: 210px; }
.slot form:first-child { height: 100%; }
.slot-btn {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 18px 12px; background: transparent; border: 0; cursor: pointer; border-radius: 18px; text-align: center;
}
.slot-btn:hover { background: var(--bg-hover); }
.slot-btn .avatar { margin-bottom: 8px; }
.slot-current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.slot-menu { position: absolute; top: 6px; right: 6px; }
.slot-delete { padding: 12px; gap: 10px; width: 260px; font-size: 14px; }
.slot-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-style: dashed; }
a.slot-empty:hover { background: var(--bg-hover); text-decoration: none; border-color: var(--accent); }
.slot-plus { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 22px; }
.slot-free { opacity: .6; }
.slot-locked { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; opacity: .45; border-style: dashed; }
.slot-locked .slot-plus { background: var(--bg-hover); }

.landing { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
.landing-art { display: grid; place-items: center; height: 100%; background: radial-gradient(circle at 30% 30%, #3b2fb0, #0b0d12 70%); }
.landing-art img { width: min(320px, 60%); filter: drop-shadow(0 20px 60px rgba(124, 108, 255, .5)); }
.landing-main { padding: 40px; display: flex; flex-direction: column; gap: 22px; max-width: 520px; }
.landing-main h1 { font-size: clamp(40px, 6vw, 64px); font-weight: 900; letter-spacing: -.03em; line-height: 1.05; }
.landing-sub { font-size: 24px; font-weight: 700; }
.landing-main .btn-steam { width: fit-content; }
.dev-login { display: flex; gap: 8px; align-items: center; padding: 12px; border: 1px dashed #f59e0b; border-radius: 12px; font-size: 13px; color: #f59e0b; }
.dev-login input { max-width: 200px; padding: 6px 10px; }

/* ---------- Admin ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border-bottom: 1px solid var(--border); }
.stat { background: var(--bg); padding: 18px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat strong { font-size: 26px; font-weight: 800; }
.stat span { font-size: 13px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.table a { color: var(--accent); }
.report { border-bottom: 1px solid var(--border); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.report-head { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.report-head a { color: var(--accent); }
.report-reason { margin: 0; padding: 10px 14px; border-left: 3px solid #f59e0b; background: rgba(245, 158, 11, .08); border-radius: 0 10px 10px 0; white-space: pre-wrap; }
.report-target { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.report-target .post { border-bottom: 0; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.report-actions input { flex: 1 1 200px; width: auto; padding: 7px 12px; }
.small a { color: var(--accent); }
.admin-user { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.admin-forms { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form label { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; }
.inline-form select, .inline-form input { width: auto; padding: 6px 10px; }
.admin-account { border-bottom: 1px solid var(--border); padding: 6px 0 12px; display: flex; flex-direction: column; gap: 8px; }
.admin-account > .admin-forms, .admin-account > .alert { margin: 0 16px; }
.admin-account .account-row { flex: 1; }
.admin-account > .row-between { padding-right: 16px; }
.admin-account.is-deleted { padding: 12px 16px; opacity: .55; }

/* ---------- Barre mobile ---------- */
.tabbar { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .shell { grid-template-columns: 88px minmax(0, 600px) 350px; }
  .sidenav { align-items: center; padding: 10px 8px; }
  .brand span, .nav-label, .compose-label, .me-names, .me-menu > summary > .icon { display: none; }
  .nav-item { padding: 12px; }
  .compose-btn { width: 52px; height: 52px; padding: 0; }
  .compose-icon { display: inline-flex; }
  .me-menu .menu-pop { left: 0; }
}
@media (max-width: 1020px) {
  .shell { grid-template-columns: 88px minmax(0, 600px); }
  .aside { display: none; }
}
@media (max-width: 640px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidenav { display: none; }
  .main { border: 0; padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; justify-content: space-around;
    background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  }
  .tabbar a { padding: 6px 14px; }
  .tabbar a.active .icon { stroke-width: 2.6; }
  .composer-inline:not(.composer-reply) { display: none; }
  .avatar-xl { width: 86px; height: 86px; font-size: 36px; }
  .profile-avatar { margin-top: -54px; }
  .landing { grid-template-columns: 1fr; }
  .landing-art { height: 200px; }
  .landing-main { padding: 24px 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .modal { margin-top: 0; width: 100vw; max-width: 100vw; min-height: 100dvh; border-radius: 0; }
  .bubble { max-width: 88%; }
  .dm-thread { height: calc(100dvh - 70px); }
  .gate-card { padding: 20px 16px; }
  .slots { grid-template-columns: repeat(2, 1fr); }
}
.fab {
  display: none; position: fixed; right: 18px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 41;
  width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; box-shadow: var(--shadow); cursor: pointer;
  place-items: center;
}
@media (max-width: 640px) { .fab { display: grid; } }
@media (min-width: 900px) {
  .dm { grid-template-columns: minmax(240px, 40%) 1fr; }
  .dm-open .dm-list, .dm:not(.dm-open) .dm-thread { display: flex; }
  .dm-list { display: flex; flex-direction: column; border-right: 1px solid var(--border); }
  .dm-back { display: none; }
  .shell:has(.dm) { grid-template-columns: 88px minmax(0, 990px); }
  .shell:has(.dm) .aside { display: none; }
  .shell:has(.dm) .brand span, .shell:has(.dm) .nav-label, .shell:has(.dm) .compose-label, .shell:has(.dm) .me-names, .shell:has(.dm) .me-menu > summary > .icon { display: none; }
  .shell:has(.dm) .sidenav { align-items: center; padding: 10px 8px; }
  .shell:has(.dm) .compose-btn { width: 52px; height: 52px; padding: 0; }
  .shell:has(.dm) .compose-icon { display: inline-flex; }
}
.dm-list { flex-direction: column; }

/* ---------- Certifications : PP carrée, mini-logo d'affiliation ---------- */
.avatar-square { border-radius: 22%; }
.avatar-xl.avatar-square { border-radius: 18%; }
.avatar-aff { width: 16px; height: 16px; font-size: 9px; border-radius: 4px; }
.aff-mini { display: inline-flex; margin-left: 3px; vertical-align: -3px; flex: none; }
.aff-mini .avatar { border: 1px solid var(--border); }
.profile-name .aff-mini .avatar { width: 20px; height: 20px; }
.aff-line { display: inline-flex; align-items: center; gap: 6px; }
.aff-line a { color: var(--text) !important; font-weight: 600; }
.aff-line .avatar-xs { border-radius: 5px; }

/* ---------- Paramètres ---------- */
.settings-block { border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.settings-help { padding: 0 16px 10px; font-size: 14px; }
.settings-links { display: flex; flex-direction: column; }
.settings-links > a, .settings-links button {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: transparent; border: 0;
  width: 100%; text-align: left; cursor: pointer; font-weight: 600; font-size: 15px;
}
.settings-links > a:hover, .settings-links button:hover { background: var(--bg-hover); text-decoration: none; }
.settings-links .icon { width: 20px; height: 20px; }
.theme-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 16px; }
.theme-opt {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 14px; cursor: pointer;
}
.theme-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.theme-opt input { margin-top: 3px; accent-color: var(--accent); }
.theme-opt span { display: flex; flex-direction: column; gap: 2px; }
.theme-opt small { font-size: 12px; }
.member { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.member:hover { background: var(--bg-hover); }
.member-name { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.member-name:hover { text-decoration: none; }
.member-name strong, .member-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member.invite { background: var(--accent-soft); }
.settings-form-row { padding: 10px 16px 0; }
.settings-form-row input { flex: 1 1 180px; width: auto; }
.danger-zone { margin: 14px 16px 0; border: 1px solid rgba(239, 68, 68, .35); border-radius: 14px; }
.danger-zone > summary { padding: 12px 16px; cursor: pointer; font-weight: 700; color: var(--danger); }
.danger-zone .form { padding: 0 16px 16px; }
.gate-sub { font-size: 16px; font-weight: 700; }
.admin-forms .check { margin: 0; }
@media (max-width: 640px) {
  .theme-picker { grid-template-columns: 1fr; }
}
