/* Thème noir : styles partagés (app + profil public) */
:root {
  --bg: #080808;
  --panel: #101010;
  --card: #131313;
  --ink: #f1f1f1;
  --muted: #8b8b8b;
  --line: #1f1f1f;
  --accent: #6d4dff;
  --accent-ink: #ffffff;
  --grad: linear-gradient(120deg, #c400ff 0%, #3a2cff 48%, #00d9ff 100%);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #242424; border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

.avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  background: #1c1c1c center/cover no-repeat;
  display: grid; place-items: center;
  font-weight: 600; color: #9a9a9a; text-transform: uppercase; font-size: 18px;
}
.avatar.lg { width: 100px; height: 100px; font-size: 40px; border: 3px solid rgba(255,255,255,.12); box-shadow: 0 6px 30px rgba(0,0,0,.5); margin: 0 auto; }

.btn {
  background: var(--grad); color: var(--accent-ink); font-weight: 600;
  padding: 10px 18px; border-radius: 999px; font-size: 15px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: transform .08s, opacity .15s;
}
.btn { box-shadow: 0 6px 22px rgba(80,60,255,.28); }
.btn:active { transform: scale(.96); }
.btn.ghost, .btn.dark, .btn.danger { box-shadow: none; }
.btn.ghost { background: rgba(255,255,255,.09); color: inherit; }
.btn.dark { background: #f1f1f1; color: #0a0a0a; }
.btn.small { padding: 7px 14px; font-size: 14px; }
.btn.danger { background: #3a1212; color: #ff7a7a; }

.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(20px);
  background: #f1f1f1; color: #0a0a0a; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 500;
  opacity: 0; transition: .25s; z-index: 200; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

.bdg { display: inline-flex; vertical-align: middle; margin-left: 6px; color: #f2b705; }

/* ---------- profil ---------- */
.pf {
  --c-card: #1b1b1b; --card-rgb: 27,27,27; --c-text: #fff; --text-rgb: 255,255,255;
  --c-icon: #fff; --icon-rgb: 255,255,255; --op: .5; --blur: 20px;
  position: relative; min-height: 100%;
  display: flex; justify-content: center; align-items: flex-start;
  padding: 76px 16px 160px; color: var(--c-text);
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.pf-card {
  width: 100%; max-width: 440px; text-align: center; padding: 30px 22px 26px; border-radius: 26px;
  background: rgba(var(--card-rgb), var(--op));
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
  border: 1px solid rgba(255,255,255,.07); position: relative; z-index: 1;
}
.pf-name { margin: 14px 0 2px; font-size: 28px; font-weight: 700; letter-spacing: -.5px; color: var(--c-text); min-height: 1.25em; }
.pf-name.glow-name { text-shadow: 0 0 12px rgba(var(--text-rgb), .85), 0 0 28px rgba(var(--text-rgb), .45); }
.pf-user { color: rgba(var(--text-rgb), .6); font-size: 15px; }
.pf-badges { margin: 12px 0 2px; display: flex; gap: 8px; justify-content: center; }
.bdg-pill { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.08); color: #f2b705; }
.pf.glow-badges .bdg-pill { box-shadow: 0 0 14px rgba(var(--icon-rgb), .7); }
.pf-bio { margin: 14px auto 4px; max-width: 340px; color: rgba(var(--text-rgb), .88); line-height: 1.45; word-wrap: break-word; }
.pf-loc { display: flex; gap: 6px; align-items: center; justify-content: center; color: rgba(var(--text-rgb), .6); font-size: 14px; margin-top: 8px; }
.pf-stats { display: flex; gap: 26px; justify-content: center; margin: 18px 0 22px; font-size: 13px; color: rgba(var(--text-rgb), .6); }
.pf-stats b { display: block; font-size: 18px; color: var(--c-text); }

/* effets sur le nom */
.fx-shimmer { background: linear-gradient(90deg, var(--c-text) 20%, rgba(var(--text-rgb), .25) 50%, var(--c-text) 80%); background-size: 220% auto; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; animation: shim 2.6s linear infinite; }
@keyframes shim { to { background-position: -220% center; } }
.fx-rainbow { background: linear-gradient(90deg, #ff4d6d, #ffb703, #f4ff2b, #3ddc97, #4cc9f0, #b57bff, #ff4d6d); background-size: 300% auto; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; animation: rb 5s linear infinite; }
@keyframes rb { to { background-position: -300% center; } }
.fx-glitch { animation: gl 2.6s infinite; }
@keyframes gl { 0%, 88%, 100% { text-shadow: none; transform: none; } 90% { text-shadow: 3px 0 #ff2d6f, -3px 0 #00e5ff; transform: translateX(1px); } 94% { text-shadow: -3px 0 #ff2d6f, 3px 0 #00e5ff; transform: translateX(-2px); } 97% { text-shadow: 2px 1px #ff2d6f, -2px -1px #00e5ff; } }
.fx-typewriter::after { content: ''; display: inline-block; width: 2px; height: .9em; margin-left: 3px; background: currentColor; vertical-align: -.08em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* liens avec logo */
.pf-links { display: flex; flex-direction: column; gap: 10px; }
.lnk {
  display: flex; align-items: center; gap: 14px; text-align: left; color: var(--c-text, var(--ink));
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px; padding: 10px 16px 10px 10px; transition: transform .12s, background .15s;
}
.lnk:hover { transform: translateY(-2px); background: rgba(255,255,255,.1); }
.lnk-ico { width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 18px; overflow: hidden; }
.lnk-ico.mono { background: rgba(255,255,255,.05); }
.lnk-ico img { width: 24px; height: 24px; object-fit: contain; }
.lnk-txt { display: flex; flex-direction: column; min-width: 0; }
.lnk-txt b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lnk-txt small { color: rgba(var(--text-rgb, 255,255,255), .55); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf.glow-links .lnk { box-shadow: 0 0 18px rgba(var(--icon-rgb), .35); }
.pf.invert .lnk { background: var(--c-text); color: var(--c-card); border-color: transparent; }
.pf.invert .lnk-txt small { color: rgba(0,0,0,.55); }
.pf.invert .lnk-ico.mono { background: rgba(0,0,0,.08); }

/* lecteur */
.player {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 18px);
  background: rgba(20,20,20,.92); color: #fff; backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px; padding: 8px 16px; display: flex; align-items: center; gap: 10px;
  z-index: 15; max-width: 92vw; box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
.player.up { bottom: calc(env(safe-area-inset-bottom) + 94px); }
.pbtn { color: #fff; display: grid; place-items: center; width: 30px; height: 30px; }
.ptitle { max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.pvol { width: 70px; accent-color: var(--accent); }

.enter {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; text-align: center;
  background: rgba(0,0,0,.7); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  color: #fff; font-size: 22px; letter-spacing: .5px; cursor: pointer;
}
.enter small { display: block; opacity: .55; font-size: 14px; margin-top: 8px; letter-spacing: 0; }

/* Vidéo d'arrière-plan : plein écran, derrière la carte, fluide sur téléphone */
.pf-video { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; pointer-events: none; background: #000; }
.ed-frame .pf-video { position: absolute; }
.pf-card { z-index: 2; }
@media (prefers-reduced-motion: reduce) { .pf-video { display: none; } }

/* Explorer */
.ex { max-width: 980px; margin: 0 auto; padding: 28px 16px 80px; }
.ex-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.ex-card { display: block; border-radius: 20px; padding: 18px; text-align: center; border: 1px solid rgba(255,255,255,.08); background: #111; transition: transform .15s; }
.ex-card:hover { transform: translateY(-3px); }
.ex-card .avatar { margin: 0 auto 10px; width: 64px; height: 64px; }
.ex-card b { display: block; font-size: 16px; }
.ex-card small { color: #8a8a8a; display: block; margin-bottom: 6px; }
.ex-card p { margin: 6px 0 0; font-size: 13px; color: #b5b5b5; word-wrap: break-word; }

.bdg img, .bdg-pill img { display: block; object-fit: contain; }
.bdg-pill { width: 36px; height: 36px; }

/* images dans le chat */
.cimg { display: block; max-width: 100%; max-height: 320px; border-radius: 14px; cursor: zoom-in; background: #1b1b1b; object-fit: contain; }
.msg .cimg { margin: -3px -8px; max-width: calc(100% + 16px); }
.msg.imgonly { padding: 4px; background: transparent !important; }
.msg.imgonly .cimg { margin: 0; max-width: 100%; }
.gt .cimg { margin-top: 6px; max-width: min(100%, 320px); }
.lb { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.92); display: grid; place-items: center; padding: 16px; cursor: zoom-out; }
.lb img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lb-x { position: absolute; top: calc(env(safe-area-inset-top) + 14px); right: 14px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; background: #1a1a1a; border: 1px solid #262626; display: grid; place-items: center; color: #cfcfcf; flex: none; }
.iconbtn:active { transform: scale(.94); }
/* actions sous la carte de profil */
.pf-actions { margin-top: 22px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* champs (partagés : app, explorer, admin) */
.field { width: 100%; background: #0d0d0d; border: 1.5px solid #222; border-radius: 14px; padding: 13px 16px; outline: none; color: var(--ink); }
.field:focus { border-color: #4a4a4a; }
.field::placeholder { color: #5f5f5f; }

/* ---- identité néon (logo F) ---- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 26px; letter-spacing: -.8px; }
.brand img { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 0 12px rgba(90,70,255,.55)); }
.gtext { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
#boot { position: fixed; inset: 0; z-index: 500; background: #080808; display: grid; place-items: center; transition: opacity .35s; }
#boot img { width: 84px; height: 84px; animation: bootp 1.3s ease-in-out infinite; filter: drop-shadow(0 0 26px rgba(90,70,255,.7)); }
#boot.out { opacity: 0; pointer-events: none; }
@keyframes bootp { 50% { transform: scale(1.12); opacity: .75; } }
