:root {
  --bg: #0d0b14; --bg2: #16121f; --card: #1d1828; --line: #2e2740; --text: #f1edf7; --muted: #a59cb8;
  --pink: #ff3d81; --cyan: #2de2e6; --violet: #8b5cf6; --green: #22c55e; --red: #ef4444; --gold: #fbbf24;
  --radius: 18px; --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --display: 'Chakra Petch', system-ui, sans-serif; --body: 'Inter', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--body); }
body { min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(139, 92, 246, .18), transparent 60%),
              radial-gradient(900px 500px at -10% 110%, rgba(255, 61, 129, .12), transparent 60%), var(--bg); }
a { color: var(--cyan); }
h1, h2, h3 { font-family: var(--display); letter-spacing: .02em; margin: 0 0 .5em; line-height: 1.15; }
h1 { font-size: clamp(28px, 5vw, 44px); }
h2 { font-size: 22px; }
h3 { font-size: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 1.6em; }
[hidden] { display: none !important; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: rgba(13, 11, 20, .85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.logo { font: 700 22px var(--display); color: var(--text); text-decoration: none; }
.logo span { color: var(--pink); }
.logo small { font: 500 12px var(--display); color: var(--cyan); margin-left: 6px; letter-spacing: .08em; text-transform: uppercase; }
.nav { display: flex; gap: 4px; }
.nav a { position: relative; display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a.on, .nav a:hover { background: var(--card); color: var(--text); }
.badge { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--pink); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
@media (max-width: 720px) { .nav a span { display: none; } .nav a { font-size: 20px; padding: 8px 10px; } }

.app { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px 16px 40px; }
.narrow { max-width: 520px; margin: 0 auto; }
.mid { max-width: 760px; margin: 0 auto; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel + .panel { margin-top: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.spacer { flex: 1; }

label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 6px; color: var(--muted); }
label .req { color: var(--pink); }
input, select, textarea { width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--violet); border-color: transparent; }
textarea { min-height: 110px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--text); font-size: 14px; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--pink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg2); color: var(--text); font: 600 15px var(--body); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--violet); }
.btn.primary { background: linear-gradient(135deg, var(--pink), var(--violet)); border: 0; color: #fff; }
.btn.danger { border-color: var(--red); color: #fecaca; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); font-size: 13px; }
.chip.hot { border-color: var(--cyan); color: var(--cyan); }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font-size: 14px; }
.picker { position: relative; }
.picker .results { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin-top: 4px; max-height: 260px; overflow: auto; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.picker .results div { padding: 9px 13px; cursor: pointer; }
.picker .results div:hover, .picker .results div.on { background: var(--card); }
.picker .chips { margin-top: 8px; }

/* Accueil */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; min-height: 60vh; }
.hero p.lead { font-size: 18px; color: var(--muted); }
.hero .pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 26px; }
.hero .pill { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 14px; }
.hero-card { aspect-ratio: 3/4; border-radius: 26px; background: linear-gradient(160deg, #2b1d44, #120e1b); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; place-items: center; font-size: 110px; transform: rotate(3deg); }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } .hero-card { display: none; } }

/* Deck */
.deck-wrap { max-width: 420px; margin: 0 auto; }
.deck { position: relative; aspect-ratio: 3/4.3; width: 100%; }
.card { position: absolute; inset: 0; border-radius: 24px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); touch-action: pan-y; user-select: none; cursor: grab; transition: transform .25s ease; }
.card.dragging { transition: none; cursor: grabbing; }
.card img, .card video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; display: block; }
.card .shade { position: absolute; inset: auto 0 0 0; padding: 80px 18px 18px; background: linear-gradient(transparent, rgba(0, 0, 0, .88)); }
.card .name { font: 700 26px var(--display); }
.card .stamp { position: absolute; top: 28px; padding: 6px 14px; border: 4px solid; border-radius: 10px; font: 700 30px var(--display); opacity: 0; transform: rotate(-14deg); }
.card .stamp.like { left: 20px; color: var(--green); }
.card .stamp.nope { right: 20px; color: var(--red); transform: rotate(14deg); }
.card .stamp.super { left: 50%; translate: -50% 0; top: auto; bottom: 160px; color: var(--cyan); transform: none; }
.card .flag { position: absolute; top: 14px; left: 14px; padding: 5px 10px; border-radius: 999px; background: var(--cyan); color: #022; font-weight: 700; font-size: 13px; }
.card .dots { position: absolute; top: 8px; left: 10px; right: 10px; display: flex; gap: 4px; }
.card .dots i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .35); }
.card .dots i.on { background: #fff; }
.card .tapzone { position: absolute; top: 0; bottom: 140px; width: 35%; }
.card .tapzone.l { left: 0; } .card .tapzone.r { right: 0; }
.actions { display: flex; justify-content: center; gap: 14px; margin-top: 18px; }
.act { width: 60px; height: 60px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 26px; cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow); }
.act:hover { transform: translateY(-2px); }
.act.nope { color: var(--red); } .act.like { color: var(--green); } .act.super { color: var(--cyan); } .act.crush { color: var(--gold); } .act.info { color: var(--violet); width: 48px; height: 48px; font-size: 20px; }
.quota { text-align: center; margin-top: 12px; }
.verified { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #3b82f6; color: #fff; font-size: 13px; vertical-align: middle; margin-left: 6px; }
.empty { text-align: center; padding: 60px 20px; }
.empty .big { font-size: 64px; }

/* Profil détaillé : photo à gauche, autres à droite (clic = échange) */
.gallery { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.gallery .main, .gallery .side > * { border-radius: 16px; overflow: hidden; background: var(--bg2); cursor: pointer; position: relative; }
.gallery .main { aspect-ratio: 4/5; }
.gallery .side { display: grid; gap: 10px; align-content: start; max-height: calc((100vw - 32px) * .67 * 1.25); overflow-y: auto; }
@media (min-width: 760px) { .gallery .side { max-height: 594px; } }
.gallery .side > * { aspect-ratio: 4/5; transition: outline .15s; }
.gallery .side > *:hover { outline: 2px solid var(--pink); }
.gallery img, .gallery video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .vid::after { content: '▶'; position: absolute; right: 8px; bottom: 6px; font-size: 14px; text-shadow: 0 0 6px #000; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.fact { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.fact b { display: block; font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.sticky-actions { position: sticky; bottom: 12px; display: flex; justify-content: center; gap: 12px; margin-top: 24px; }

/* Édition médias */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.media-grid .m { position: relative; aspect-ratio: 4/5; border-radius: 12px; overflow: hidden; background: var(--bg2); border: 1px solid var(--line); }
.media-grid img, .media-grid video { width: 100%; height: 100%; object-fit: cover; }
.media-grid .m .tools { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; padding: 4px; background: rgba(0, 0, 0, .6); }
.media-grid .m .tools button { background: none; border: 0; color: #fff; cursor: pointer; font-size: 15px; }
.media-grid .add { display: grid; place-items: center; font-size: 32px; color: var(--muted); cursor: pointer; border-style: dashed; }

/* Messagerie */
.chat-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; min-height: 70vh; }
@media (max-width: 760px) { .chat-layout { grid-template-columns: 1fr; } .chat-layout.has-conv .conv-list { display: none; } }
.conv-list { display: flex; flex-direction: column; gap: 6px; }
.conv { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; text-decoration: none; color: var(--text); border: 1px solid transparent; }
.conv:hover, .conv.on { background: var(--card); border-color: var(--line); }
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--bg2); flex: none; }
.conv .txt { flex: 1; min-width: 0; }
.conv .txt div:last-child { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-height: 70vh; }
.chat .head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat .msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; max-height: 60vh; }
.bubble { max-width: 75%; padding: 9px 13px; border-radius: 16px; background: var(--bg2); white-space: pre-wrap; word-wrap: break-word; }
.bubble.mine { align-self: flex-end; background: linear-gradient(135deg, var(--pink), var(--violet)); }
.bubble.crush { border: 1px solid var(--gold); }
.bubble.crush::before { content: '💌 CrushNote'; display: block; font-size: 11px; color: var(--gold); font-weight: 700; margin-bottom: 2px; }
.bubble.sys { align-self: center; max-width: 92%; background: #1e293b; border: 1px solid #3b82f6; }
.chat form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }

.toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; padding: 12px 18px; border-radius: 12px; background: #fff; color: #111; font-weight: 600; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; }
.toast.err { background: var(--red); color: #fff; }

.modal { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .7); display: grid; place-items: center; padding: 16px; }
.modal .panel { width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; }
.match-pop h1 { background: linear-gradient(135deg, var(--pink), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; text-align: center; font-size: 46px; }

.plan { border: 2px solid var(--pink); }
.plan .price { font: 700 44px var(--display); }
.plan ul { padding-left: 18px; }
.camera { width: 100%; border-radius: 16px; background: #000; aspect-ratio: 3/4; object-fit: cover; }
.word { font: 700 34px var(--display); letter-spacing: .1em; text-align: center; padding: 14px; border: 2px dashed var(--cyan); border-radius: 14px; color: var(--cyan); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.thumbs img { width: 90px; height: 112px; object-fit: cover; border-radius: 8px; }

.foot { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; padding: 20px 16px 28px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.foot a { color: var(--muted); }
.foot span { color: var(--pink); font-weight: 600; width: 100%; text-align: center; }

/* Bandeau « confirme ton e-mail » */
.mail-banner { max-width: 1100px; margin: 12px auto 0; padding: 10px 16px; border: 1px solid var(--gold); border-radius: 12px; background: color-mix(in srgb, var(--gold) 12%, transparent); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 14px; }
@media (max-width: 1132px) { .mail-banner { margin: 12px 16px 0; } }

/* Qui m'a liké */
.likes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.like-card { position: relative; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; background: var(--card); border: 1px solid var(--line); display: block; color: #fff; text-decoration: none; }
.like-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.like-card .info { position: absolute; inset: auto 0 0 0; padding: 28px 12px 10px; background: linear-gradient(transparent, #000d 35%, #000f); font-weight: 700; }
.like-card .info small { display: block; font-weight: 400; opacity: .8; }
.like-card .tag { position: absolute; top: 8px; left: 8px; background: var(--cyan); color: #111; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.like-card.locked img { transform: scale(1.15); filter: saturate(.8); }
.like-card.locked .lock { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; background: #0003; }
.likes-upsell { text-align: center; }
