/* WhereImAt? — styles des fonctionnalités communautaires */

/* ---------- Transitions ---------- */
header { view-transition-name: appheader; }
::view-transition-old(root) { animation: vt-out .16s ease both; }
::view-transition-new(root) { animation: vt-in .26s cubic-bezier(.2,.8,.2,1) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
.fade-in { animation: fade-up .38s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(min(var(--i, 0), 12) * 35ms); }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } }
dialog[open] { animation: dlg-in .24s cubic-bezier(.2,.8,.2,1); }
dialog[open]::backdrop { animation: bd-in .2s ease; }
@keyframes bd-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root), .fade-in, dialog[open], dialog[open]::backdrop { animation: none; }
}

/* ---------- Navigation de l'appli ---------- */
.appnav { display: flex; gap: 4px; margin-left: 18px; }
.appnav a { position: relative; padding: 9px 14px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 14px; transition: color .15s, background .15s; display: flex; align-items: center; gap: 8px; }
.appnav a svg { flex: none; }
.appnav a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.appnav a.on { color: var(--text); }
.appnav a.on::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 3px; border-radius: 3px; background: var(--accent); }
.me-btn { margin-left: auto; display: flex; align-items: center; gap: 10px; background: none; border: 1px solid transparent; border-radius: 999px; padding: 4px 12px 4px 4px; color: var(--text); transition: background .15s, border-color .15s; }
.me-btn:hover { background: rgba(255,255,255,.05); border-color: var(--line); }
.me-btn .who { font-weight: 700; font-size: 13px; }
.me-menu { position: absolute; right: 24px; top: calc(100% - 6px); z-index: 30; min-width: 220px; background: #14161c; border: 1px solid #262b36; border-radius: 14px; padding: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.6); animation: dlg-in .18s ease; }
.me-menu a, .me-menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; border: 0; background: none; color: var(--text); text-decoration: none; font-size: 14px; text-align: left; }
.me-menu a:hover, .me-menu button:hover { background: #1f232c; }
.me-menu hr { border: 0; border-top: 1px solid #262b36; margin: 6px 4px; }
.list-toolbar { display: flex; gap: 10px; align-items: center; padding-top: 22px; }
.list-toolbar h1 { margin: 0 auto 0 0; font-family: 'Lilita One', sans-serif; font-weight: 400; font-size: 32px; }
.list-toolbar .search { margin-left: 0; }

/* ---------- Avatars ---------- */
.av { display: inline-grid; place-items: center; flex: none; border-radius: 50%; object-fit: cover; color: #0b0d11; font-weight: 800; font-family: 'Lilita One', sans-serif; overflow: hidden; background: #2a2f3a; }
.who-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 700; min-width: 0; }
.who-link:hover .h { color: var(--accent); }
.who-link .h { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-link small { color: var(--muted); font-weight: 400; }

/* ---------- Pages ---------- */
.page { padding: 26px 0 60px; }
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0 auto 0 0; font-family: 'Lilita One', sans-serif; font-weight: 400; font-size: 34px; line-height: 1.1; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs button { position: relative; background: none; border: 0; padding: 12px 14px; color: var(--muted); font-weight: 700; white-space: nowrap; transition: color .15s; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.tabs button b { font-weight: 700; color: var(--muted); margin-left: 4px; }
.feed { display: flex; flex-direction: column; gap: 14px; }
.empty-s { text-align: center; color: var(--muted); padding: 50px 16px; border: 1px dashed var(--line); border-radius: 16px; }
.empty-s b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.sk { background: #1a1d24; border-radius: 16px; height: 120px; animation: shimmer 1.4s ease-in-out infinite; }

/* Cartes avis / recommandations */
.post { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; transition: border-color .15s, transform .15s; }
.post:hover { border-color: #353b48; }
.post .cov { width: 84px; height: 120px; border-radius: 10px; background: #1f232c center / cover no-repeat; flex: none; }
.post-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.post-top { display: flex; align-items: center; gap: 10px; }
.post-top .when { margin-left: auto; }
.post h3 { margin: 0; font-size: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.post p { margin: 0; color: #c9ced8; white-space: pre-wrap; word-break: break-word; line-height: 1.55; }
.post-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: auto; padding-top: 4px; }
.vote { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; color: var(--muted); transition: all .15s; }
.vote:hover { color: var(--text); border-color: #3a4150; }
.vote b { color: var(--text); }
.vote.up.on { background: rgba(255,107,74,.16); border-color: var(--accent); color: var(--accent); }
.vote.down.on { background: rgba(139,146,161,.16); border-color: var(--muted); color: var(--text); }
.score-pill { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: rgba(255,107,74,.14); color: var(--accent); }
.stars-ro { color: #ffc93c; letter-spacing: 1px; font-size: 15px; }
.stars-ro s { text-decoration: none; color: #3a4150; }

/* ---------- Profil ---------- */
.prof-banner { height: 190px; border-radius: 0 0 22px 22px; margin: 0 -16px; position: relative; overflow: hidden; }
.prof-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(15,17,21,.6), rgba(15,17,21,0) 60%); }
.prof-head { display: flex; gap: 20px; align-items: flex-end; margin-top: -64px; position: relative; z-index: 1; flex-wrap: wrap; }
.prof-head .av { border: 5px solid var(--bg); box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.prof-id { flex: 1; min-width: 200px; padding-bottom: 6px; }
.prof-id h1 { margin: 0; font-family: 'Lilita One', sans-serif; font-weight: 400; font-size: 34px; line-height: 1.1; }
.prof-id .handle { color: var(--muted); }
.prof-actions { display: flex; gap: 8px; padding-bottom: 10px; }
.prof-bio { margin: 16px 0 6px; color: #c9ced8; white-space: pre-wrap; max-width: 720px; line-height: 1.6; }
.prof-fav { color: var(--muted); font-size: 13px; margin: 0 0 6px; }
.prof-fav b { color: var(--text); }
.prof-stats { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; min-width: 96px; text-align: left; color: var(--text); }
button.stat { cursor: pointer; transition: border-color .15s; }
button.stat:hover { border-color: var(--accent); }
.stat b { display: block; font-size: 20px; font-family: 'Lilita One', sans-serif; font-weight: 400; }
.stat span { font-size: 12px; color: var(--muted); }
.follow-btn.on { background: transparent; border: 1px solid var(--line); color: var(--text); }
.follow-btn.on:hover { border-color: #ff7b7b; color: #ff7b7b; }
.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: 0; }
.comment-body { flex: 1; min-width: 0; }
.comment-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.comment p { margin: 6px 0 0; color: #c9ced8; white-space: pre-wrap; word-break: break-word; }
.composer { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
.composer textarea, .sdlg textarea { width: 100%; resize: vertical; min-height: 80px; background: #0b0d11; border: 1px solid #262b36; border-radius: 12px; padding: 12px; outline: none; color: var(--text); font: inherit; line-height: 1.5; }
.composer textarea:focus, .sdlg textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255,107,74,.12); }
.composer-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.composer-row .grow { flex: 1; }
.counter { font-size: 12px; color: var(--muted); }
.star-pick { display: flex; gap: 2px; align-items: center; }
.star-pick .star { font-size: 22px; }
.star-pick small { color: var(--muted); margin-left: 8px; font-size: 12px; }

/* Membres */
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.member { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.member:hover { border-color: var(--accent); transform: translateY(-2px); }
.member .m-body { min-width: 0; }
.member b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.searchbar { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; max-width: 420px; transition: border-color .15s; }
.searchbar:focus-within { border-color: var(--accent); }
.searchbar input { flex: 1; border: 0; outline: none; background: none; }

/* ---------- Discussions ---------- */
.chat { display: grid; grid-template-columns: 280px 1fr; gap: 16px; height: calc(100vh - 200px); min-height: 460px; }
.rooms { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 10px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.rooms .room { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; color: var(--text); text-decoration: none; border: 1px solid transparent; transition: background .15s; }
.rooms .room:hover { background: #1f232c; }
.rooms .room.on { background: rgba(255,107,74,.12); border-color: rgba(255,107,74,.35); }
.room-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #232833; font-weight: 800; flex: none; }
.room.on .room-ic { background: var(--accent); color: #1a0904; }
.rooms .room small { display: block; color: var(--muted); font-size: 12px; }
.rooms-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 8px; font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
.chat-main { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat-head h2 { margin: 0; font-size: 17px; }
.chat-head small { color: var(--muted); }
.chat-head .grow { flex: 1; min-width: 0; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.msg { display: flex; gap: 10px; padding: 6px 8px; border-radius: 12px; transition: background .15s; }
.msg:hover { background: rgba(255,255,255,.025); }
.msg.cont { padding-top: 0; }
.msg.cont .msg-av { visibility: hidden; height: 0; }
.msg-av { width: 36px; flex: none; }
.msg-body { min-width: 0; flex: 1; }
.msg-top { display: flex; gap: 8px; align-items: baseline; }
.msg-top a { color: var(--text); font-weight: 700; text-decoration: none; }
.msg-top a:hover { color: var(--accent); }
.msg-text { color: #d6dae2; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.msg-del { margin-left: auto; opacity: 0; background: none; border: 0; color: var(--muted); font-size: 12px; }
.msg:hover .msg-del { opacity: 1; }
.chat-compose { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-compose textarea { flex: 1; resize: none; min-height: 46px; max-height: 140px; background: #0b0d11; border: 1px solid #262b36; border-radius: 12px; padding: 12px; outline: none; color: var(--text); font: inherit; }
.chat-compose textarea:focus { border-color: var(--accent); }
.send-btn { height: 46px; width: 46px; border-radius: 12px; border: 0; background: linear-gradient(135deg, #ff7f57, #ff5a3c); color: #1a0904; display: grid; place-items: center; flex: none; transition: transform .15s, filter .15s; }
.send-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.day-sep { text-align: center; color: var(--muted); font-size: 12px; margin: 12px 0 6px; }

/* ---------- Paramètres ---------- */
.settings { display: grid; gap: 16px; max-width: 760px; }
.set-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.set-card h2 { margin: 0 0 4px; font-size: 18px; }
.set-card > p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.set-grid { display: grid; gap: 14px; }
.set-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.set-input { width: 100%; height: 48px; background: #0b0d11; border: 1px solid #262b36; border-radius: 12px; padding: 0 14px; outline: none; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.set-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255,107,74,.12); }
.field-l { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: #aab1bf; margin-bottom: 7px; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.field-hint.ok { color: #9be7c4; }
.field-hint.bad { color: #ffb4a8; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; transition: transform .15s; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.swatch:hover { transform: scale(1.1); }
.swatch.on { border-color: var(--text); }
.banners { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.banner-opt { height: 56px; border-radius: 12px; border: 3px solid transparent; cursor: pointer; transition: transform .15s; position: relative; }
.banner-opt span { position: absolute; left: 8px; bottom: 5px; font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.banner-opt:hover { transform: translateY(-2px); }
.banner-opt.on { border-color: var(--text); }
.set-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.btn-main { height: 46px; padding: 0 22px; border: 0; border-radius: 12px; background: linear-gradient(135deg, #ff7f57, #ff5a3c); color: #1a0904; font-weight: 800; transition: transform .15s, filter .15s; }
.btn-main:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn-main:disabled { opacity: .6; cursor: progress; transform: none; }
.btn-soft { height: 46px; padding: 0 18px; border: 1px solid #262b36; border-radius: 12px; background: transparent; color: var(--text); font-weight: 700; transition: background .15s, border-color .15s; }
.btn-soft:hover { background: #1f232c; border-color: #3a4150; }
.btn-soft.danger { color: #ff8a7a; border-color: #4a2a2a; }

/* ---------- Fenêtres ---------- */
.sdlg { width: min(620px, calc(100vw - 24px)); border-radius: 22px; border: 1px solid #262b36; background: #111318; }
.sdlg .dlg-head { background: #111318; }
.sdlg .dlg-body { display: flex; flex-direction: column; gap: 14px; }
.media-pick { display: flex; flex-direction: column; gap: 10px; }
.media-sel { display: flex; gap: 12px; align-items: center; background: #0b0d11; border: 1px solid var(--accent); border-radius: 14px; padding: 10px; }
.media-sel .cov { width: 46px; height: 66px; border-radius: 8px; background: #1f232c center / cover; flex: none; }
.media-sel .grow { flex: 1; min-width: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-m { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #0b0d11; border-radius: 999px; padding: 5px 10px; font-size: 12px; color: var(--text); }
.chip-m:hover { border-color: var(--accent); }
.chip-m button { background: none; border: 0; color: var(--muted); padding: 0; }
.plist { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; }
.plist a, .plist button.pitem { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; color: var(--text); text-decoration: none; background: none; border: 0; text-align: left; width: 100%; }
.plist a:hover, .plist button.pitem:hover { background: #1f232c; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  /* Le flou et le nom de transition de l'en-tête « piégeraient » la barre fixe : on les retire sur mobile */
  #appView header { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(15,17,21,.97); view-transition-name: none; }
  .appnav { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; z-index: 25; justify-content: space-around; background: rgba(12,13,17,.97); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); backdrop-filter: blur(10px); }
  .appnav a { flex-direction: column; gap: 3px; font-size: 11px; padding: 6px 8px; }
  .appnav a.on::after { left: 30%; right: 30%; bottom: auto; top: -7px; }
  body.app { padding-bottom: 72px; }
  .me-btn .who { display: none; }
  .chat { grid-template-columns: 1fr; height: auto; }
  .chat.in-room .rooms { display: none; }
  .chat:not(.in-room) .chat-main { display: none; }
  .chat-main { height: calc(100vh - 230px); }
  .post .cov { width: 64px; height: 92px; }
  .prof-banner { height: 140px; }
}
