:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --ink: #2a2433;
  --muted: #7a7285;
  --brand: #7b3fa0;
  --brand-2: #c9873a;
  --line: #e6e0d8;
  --ok: #2e8b57;
  --no: #c0392b;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #e9e4dc;
  color: var(--ink);
}
.app {
  max-width: 480px; margin: 0 auto; min-height: 100vh;
  background: var(--bg); display: flex; flex-direction: column;
  box-shadow: 0 0 40px rgba(0,0,0,.08);
}
.topbar {
  padding: 14px 16px; background: var(--brand); color: #fff;
  display: flex; align-items: baseline; gap: 12px; position: sticky; top: 0; z-index: 5;
}
.logo { font-weight: 800; font-size: 22px; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.hero-logo { text-align: center; margin: 4px 0 6px; }
.hero-logo img { width: 120px; height: 120px; border-radius: 28px; box-shadow: 0 10px 30px rgba(240,138,36,.35); }
.hero-logo .wordmark {
  font-family: Georgia, "Times New Roman", serif; font-size: 40px; font-weight: 700; margin-top: 6px;
  background: linear-gradient(0deg, #d9401f, #f08a24 55%, #ffb43a); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo-img { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }

/* ----- Thèmes de couleurs (à choisir dans Profil) ----- */
:root[data-theme="nuit"]     { --brand: #1f3a6b; --brand-2: #d4a23c; --bg: #f2f4f8; }
:root[data-theme="bordeaux"] { --brand: #7a1f35; --brand-2: #d9a441; --bg: #f8f2ef; }
:root[data-theme="olivier"]  { --brand: #3f6b3a; --brand-2: #c9873a; --bg: #f3f5ee; }
:root[data-theme="ciel"]     { --brand: #2a7fb8; --brand-2: #f0a830; --bg: #f1f6fa; }
.themes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }
.themes button { border: 2px solid transparent; border-radius: 12px; padding: 6px 2px; background: #fff; cursor: pointer; font-size: 11px; color: var(--ink); }
.themes button.on { border-color: var(--ink); }
.themes .sw { display: flex; height: 26px; border-radius: 8px; overflow: hidden; margin-bottom: 4px; }
.themes .sw i { flex: 1; }
.tagline { font-size: 13px; opacity: .85; }
.view { flex: 1; padding: 16px; padding-bottom: 90px; }
.tabs {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; display: grid; grid-template-columns: repeat(7, auto); justify-content: space-around;
  background: #fff; border-top: 1px solid var(--line); z-index: 5;
}
.tabs button {
  border: 0; background: none; padding: 8px 0 10px; font-size: 10px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer;
}
.tabs button span { font-size: 20px; }
.tabs button.active { color: var(--brand); font-weight: 700; }
.tabs button { position: relative; }
.tabs .dot { position: absolute; top: 6px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: #e74c3c; }

h2 { margin: 4px 0 12px; font-size: 20px; }
h3 { margin: 16px 0 8px; font-size: 16px; }
p { line-height: 1.45; }
.muted { color: var(--muted); font-size: 14px; }

.card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05); margin-bottom: 12px;
}
.avatar {
  border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800;
  flex-shrink: 0;
}
.profile-card { padding: 0; overflow: hidden; }
.profile-card .hero {
  height: 260px; display: grid; place-items: center; color: #fff; font-size: 80px; font-weight: 800;
  position: relative;
}
.profile-card .hero .name {
  position: absolute; left: 16px; bottom: 12px; font-size: 26px; text-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.profile-card .body { padding: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip {
  background: #f1eaf6; color: var(--brand); border-radius: 999px; padding: 4px 10px; font-size: 13px;
}
.chip.gold { background: #faf0e2; color: #96601f; }
.verse { font-style: italic; border-left: 3px solid var(--brand-2); padding-left: 10px; color: #5a4f63; }

.actions { display: flex; justify-content: center; gap: 28px; margin: 16px 0; }
.round {
  width: 64px; height: 64px; border-radius: 50%; border: 0; font-size: 28px; cursor: pointer;
  background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.round.pass { color: var(--no); }
.round.like { color: #fff; background: var(--brand); }

.btn {
  border: 0; border-radius: 12px; padding: 12px 16px; font-size: 15px; font-weight: 700; cursor: pointer;
  background: var(--brand); color: #fff; width: 100%;
}
.btn.secondary { background: #fff; color: var(--brand); border: 2px solid var(--brand); }
.btn.small { width: auto; padding: 8px 12px; font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }

label { display: block; font-size: 13px; font-weight: 700; margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: #fff;
}
textarea { min-height: 70px; resize: vertical; }

.list-item { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .last { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat { display: flex; flex-direction: column; gap: 8px; margin-bottom: 70px; }
.bubble { max-width: 78%; padding: 9px 12px; border-radius: 14px; font-size: 15px; }
.bubble.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.bubble.them { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; }
.composer {
  position: fixed; bottom: 62px; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  display: flex; gap: 8px; padding: 10px 16px; background: var(--bg); border-top: 1px solid var(--line);
}
.composer .btn { width: auto; }

.segment { display: flex; background: #fff; border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.segment button {
  flex: 1; border: 0; background: none; padding: 8px; border-radius: 9px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.segment button.active { background: var(--brand); color: #fff; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.item { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.item .thumb { height: 90px; display: grid; place-items: center; font-size: 36px; }
.item .info { padding: 10px; }
.item .title { font-weight: 700; font-size: 14px; }
.price { color: var(--brand); font-weight: 800; }
.tag { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }

.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.back { background: none; border: 0; color: var(--brand); font-weight: 700; cursor: pointer; padding: 0; margin-bottom: 10px; font-size: 15px; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; opacity: 0;
  transition: .25s; pointer-events: none; z-index: 20; font-size: 14px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ----- Appels & messages vocaux ----- */
.call-btn { border: 0; background: var(--brand); color: #fff; width: 40px; height: 40px; border-radius: 50%; font-size: 18px; cursor: pointer; margin-left: 6px; flex-shrink: 0; }
.call-btn.off { background: #cfc8d6; }
.video-consent { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 13px; background: #fff; border-radius: 12px; padding: 8px 10px; margin: 0 0 10px; }
.video-consent input { width: auto; margin-top: 2px; }
.video-consent .muted { font-size: 11px; }
.bubble.voice { display: flex; align-items: center; gap: 6px; }
.bubble.voice audio { height: 32px; max-width: 190px; }
.bubble.voice .dur { font-size: 11px; opacity: .8; }
#chat.chat { margin-bottom: 4px; }
.typing { font-size: 12px; color: var(--brand); font-style: italic; margin: 4px 2px 0; }
.seen { text-align: right; font-size: 11px; color: var(--muted); margin: 2px 2px 76px; min-height: 14px; }
.call-log { align-self: center; font-size: 12px; color: var(--muted); background: #fff; border-radius: 999px; padding: 4px 12px; }
.composer .mic { border: 0; background: #fff; border-radius: 50%; width: 42px; height: 42px; font-size: 18px; cursor: pointer; flex-shrink: 0; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.composer .mic.rec { background: #e74c3c; color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.1); } }
.call-screen {
  position: fixed; inset: 0; z-index: 40; color: #fff; display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  background: radial-gradient(circle at 50% 35%, var(--brand), #17121d 75%); padding: 40px 16px 34px;
}
.call-top { text-align: center; }
.call-name { font-size: 28px; font-weight: 800; }
.call-status { opacity: .85; margin-top: 4px; }
.call-center .avatar { box-shadow: 0 0 0 10px rgba(255,255,255,.08), 0 0 0 22px rgba(255,255,255,.05); animation: ringing 1.4s ease-in-out infinite; }
.call-screen.live .call-center .avatar { animation: none; }
@keyframes ringing { 50% { box-shadow: 0 0 0 16px rgba(255,255,255,.12), 0 0 0 34px rgba(255,255,255,.05); } }
.call-screen .self { position: absolute; right: 16px; top: 110px; width: 110px; height: 150px; object-fit: cover; border-radius: 14px; background: #000; border: 2px solid rgba(255,255,255,.5); transform: scaleX(-1); }
.call-actions { display: flex; gap: 22px; }
.call-actions button { width: 62px; height: 62px; border-radius: 50%; border: 0; font-size: 24px; cursor: pointer; background: rgba(255,255,255,.18); color: #fff; }
.call-actions button.muted-btn { background: #fff; color: #222; text-decoration: line-through; }
.call-actions .end { background: #e74c3c; transform: rotate(135deg); }

/* ----- Profil ----- */
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 10px; font-size: 14px; }
.details > div { display: flex; flex-direction: column; background: #faf8f4; border-radius: 10px; padding: 6px 10px; }
.details .muted { font-size: 12px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.photos .ph { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: #eee; }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; }
.photos .ph button { position: absolute; top: 6px; left: 6px; border: 0; border-radius: 50%; width: 26px; height: 26px; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; }
.photos .ph button.del { left: auto; right: 6px; }
.photos .ph .main { position: absolute; left: 6px; bottom: 6px; background: var(--brand); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.shop-cover { display: block; width: calc(100% + 32px); margin: 0 -16px 12px; height: 160px; object-fit: cover; }
.contact { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.contact a {
  font-size: 12px; text-decoration: none; color: var(--ink); background: #f4f0ea; border-radius: 8px; padding: 5px 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
label.btn { display: inline-block; text-align: center; }

/* ----- Statut ----- */
.post { padding: 14px; }
.post .head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.post .head .who { font-weight: 700; }
.post .head .when { color: var(--muted); font-size: 12px; }
.post .text { white-space: pre-wrap; margin: 6px 0; }
.post .media { width: 100%; border-radius: 12px; margin: 6px 0; max-height: 420px; object-fit: cover; background: #000; }
.post.official { border: 2px solid var(--brand-2); }
.badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; letter-spacing: .3px; }
.badge.temoignage { background: #e7f4ec; color: #22744a; }
.badge.verset { background: #f1eaf6; color: var(--brand); }
.badge.photo, .badge.video { background: #e6eef8; color: #2f5f9a; }
.badge.evenement { background: #faf0e2; color: #96601f; }
.badge.annonce { background: #fde8e8; color: #a32d2d; }
.verse-big {
  background: linear-gradient(135deg, var(--brand), #2a2433); color: #fff; border-radius: 12px;
  padding: 22px 18px; font-size: 18px; font-style: italic; text-align: center; margin: 6px 0;
}
.verse-big .ref { display: block; margin-top: 8px; font-style: normal; font-size: 14px; opacity: .85; }
.event-box { background: #fbf6ee; border-radius: 12px; padding: 12px; margin: 6px 0; }
.event-box .date { font-weight: 800; color: #96601f; }
.post .bar { display: flex; gap: 8px; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.post .bar button {
  border: 0; background: #f4f0ea; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--ink);
}
.post .bar button.on { background: var(--brand); color: #fff; }
.comments { margin-top: 8px; font-size: 14px; }
.comments .c { padding: 4px 0; }
.comments form { display: flex; gap: 6px; margin-top: 6px; }
.comments form .btn { width: auto; }
.fab {
  position: fixed; right: max(16px, calc(50% - 240px + 16px)); bottom: 80px; width: 56px; height: 56px; border-radius: 50%;
  border: 0; background: var(--brand-2); color: #fff; font-size: 30px; box-shadow: 0 6px 18px rgba(0,0,0,.2); cursor: pointer; z-index: 6;
}
.hscroll { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; }
.hscroll .chip { white-space: nowrap; cursor: pointer; }

.match-pop {
  position: fixed; inset: 0; background: rgba(42,36,51,.85); display: grid; place-items: center; z-index: 30;
  color: #fff; text-align: center; padding: 20px;
}
.match-pop h1 { font-size: 34px; margin: 0 0 6px; }

/* ----- Panel (appels de groupe) ----- */
.panel-ico { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; font-size: 24px; background: var(--brand-2); }
.panel-item .btn.small { margin-left: 6px; }
label.pick { cursor: pointer; }
label.pick input { width: auto; margin-right: 6px; }
.panel-invite { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; }
.panel-screen { justify-content: flex-start; gap: 14px; padding-top: 28px; }
.panel-grid { flex: 1; width: 100%; max-width: 720px; display: grid; gap: 8px; grid-template-columns: 1fr 1fr; align-content: center; }
.panel-grid[data-n="1"], .panel-grid[data-n="2"] { grid-template-columns: 1fr; }
.tile { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; }
.panel-grid[data-n="1"] .tile, .panel-grid[data-n="2"] .tile { aspect-ratio: 4 / 3; max-height: 34vh; justify-self: center; width: 100%; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.tile video.mine { transform: scaleX(-1); }
.tile.cam-on video { display: block; }
.tile.cam-on .tile-av { visibility: hidden; }
.tile-name { position: absolute; left: 8px; bottom: 8px; font-size: 13px; font-weight: 700; background: rgba(0,0,0,.45); padding: 2px 8px; border-radius: 999px; }
.tile-state { position: absolute; right: 8px; top: 8px; font-size: 11px; opacity: .85; }

/* ----- Fenêtre en bas d'écran (signaler, bloquer) ----- */
.sheet-bg { position: fixed; inset: 0; background: rgba(42,36,51,.6); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.sheet label.reason { display: block; padding: 10px 12px; border: 1px solid rgba(0,0,0,.1); border-radius: 10px; font-size: 14px; }
.sheet label.reason:has(input:checked) { border-color: var(--brand); background: rgba(0,0,0,.03); }

/* Événements */
.event-card { cursor: pointer; overflow: hidden; }
.event-card .event-cover { display: block; width: calc(100% + 32px); margin: -16px -16px 12px; height: 150px; object-fit: cover; }
.event-date { flex: 0 0 48px; text-align: center; background: var(--brand); color: #fff; border-radius: 10px; padding: 6px 0; line-height: 1.1; }
.event-date b { display: block; font-size: 20px; }
.event-date span { font-size: 11px; text-transform: uppercase; }
.card > .chip { display: inline-block; }
