:root {
  --ink: #111; --text: #141414; --muted: #8e8e93; --faint: #b9b9be; --line: #ececef; --field: #f4f4f6; --canvas: #f5f5f7; --bg: #fff; --heart: #ff3b30; --online: #30d158;
  --shadow: 0 8px 24px rgba(0,0,0,.06); --r: 28px;
  --display: Unbounded, system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; }
body { font-family: Figtree, system-ui, sans-serif; color: var(--text); background: var(--canvas); -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea { font: inherit; color: inherit; }
img { display: block; }

/* Splash */
#splash { position: fixed; inset: 0; background: var(--ink); display: grid; place-items: center; z-index: 100; transition: opacity .5s, transform .5s; }
#splash img { width: 180px; animation: fadeUp .5s ease-out both; }
#splash.out { opacity: 0; pointer-events: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }
@keyframes shimmer { 50% { opacity: .45; } }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-7px); } }

/* Layout */
.shell { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding: 24px; min-height: 100vh; }
.side { position: sticky; top: 24px; align-self: start; background: var(--bg); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.side img.logo { height: 26px; margin-bottom: 26px; }
.nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 16px; font-weight: 500; margin-bottom: 4px; }
.nav button.on { background: var(--ink); color: #fff; }
.nav .badge { margin-left: auto; background: var(--heart); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px; }
.panel { background: var(--bg); border-radius: var(--r); padding: 28px; box-shadow: var(--shadow); animation: fadeUp .35s ease both; min-height: 70vh; }
h1 { font-family: var(--display); font-size: 26px; font-weight: 500; letter-spacing: -.4px; line-height: 1.2; }
h2 { font-size: 18px; font-weight: 600; margin: 22px 0 12px; }
.sub { color: var(--muted); line-height: 1.5; margin-top: 8px; }

/* Composants */
.btn { height: 52px; padding: 0 28px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; transition: transform .15s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: scale(.95); }
.btn.light { background: #fff; color: var(--ink); box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.round { width: 56px; height: 56px; border-radius: 50%; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.08); display: grid; place-items: center; font-size: 22px; transition: transform .15s; }
.round:hover { transform: scale(1.06); } .round.dark { background: var(--ink); color: #fff; }
.field { width: 100%; height: 54px; border-radius: 20px; background: var(--field); border: 1px solid transparent; padding: 0 18px; margin: 6px 0 14px; outline: none; }
.field:focus { border-color: var(--ink); }
textarea.field { height: 110px; padding: 14px 18px; resize: vertical; }
label { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.chip { padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 14px; font-weight: 500; margin: 0 8px 8px 0; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.avatar { border-radius: 50%; object-fit: cover; background: var(--field); }
.skeleton { background: var(--field); border-radius: 14px; animation: shimmer 1.4s infinite; }
.dots { display: flex; gap: 6px; justify-content: center; padding: 20px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); animation: bounce 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 20px; margin-bottom: 6px; }
#toast { position: fixed; top: 18px; left: 50%; transform: translate(-50%, -120px); background: #fff; border-radius: 20px; padding: 14px 20px; box-shadow: var(--shadow); transition: transform .35s cubic-bezier(.3,1.4,.5,1); z-index: 90; font-weight: 500; max-width: 90vw; }
#toast.show { transform: translate(-50%, 0); } #toast.error { color: var(--heart); }

/* Landing */
.landing { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--ink); color: #fff; }
.landing .hero { padding: 7vw; display: flex; flex-direction: column; justify-content: center; }
.landing .hero img { height: 46px; width: auto; align-self: flex-start; margin-bottom: 40px; }
.landing h1 { font-size: clamp(30px, 4vw, 50px); letter-spacing: -1px; }
.landing .hero .sub { color: rgba(255,255,255,.7); font-size: 18px; max-width: 520px; }
.landing .stores { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.landing .card { background: #fff; color: var(--text); margin: 4vw; border-radius: 36px; padding: 40px; align-self: center; animation: fadeUp .5s ease both; }
.code { display: flex; gap: 8px; } .code input { width: 48px; height: 60px; text-align: center; font-size: 24px; font-weight: 600; border-radius: 16px; background: var(--field); border: 1.5px solid transparent; }

/* Découvrir */
.deck { position: relative; height: 560px; max-width: 400px; margin: 10px auto 0; }
.pcard { position: absolute; inset: 0; border-radius: 36px; overflow: hidden; background: var(--field) center/cover; transition: transform .3s, opacity .3s; box-shadow: var(--shadow); }
.pcard .info { position: absolute; left: 0; right: 0; bottom: 0; padding: 80px 22px 22px; background: linear-gradient(transparent, rgba(0,0,0,.78)); color: #fff; }
.pcard .info h3 { font-family: var(--display); font-size: 24px; font-weight: 500; } .pcard .info p { opacity: .9; margin-top: 4px; font-size: 14px; line-height: 1.4; }
.pcard.like { transform: translateX(140%) rotate(14deg); opacity: 0; } .pcard.pass { transform: translateX(-140%) rotate(-14deg); opacity: 0; } .pcard.super { transform: translateY(-140%); opacity: 0; }
.actions { display: flex; justify-content: center; gap: 16px; margin-top: 20px; }
.picks { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.picks button { text-align: center; font-size: 12px; font-weight: 500; }
.ring { padding: 2px; border-radius: 50%; border: 2px solid var(--ink); display: inline-block; }

/* Messages */
.msgs { display: grid; grid-template-columns: 300px 1fr; gap: 0; height: 74vh; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; }
.conv-list { border-right: 1px solid var(--line); overflow-y: auto; }
.conv { display: flex; gap: 12px; align-items: center; padding: 12px 16px; width: 100%; text-align: left; }
.conv:hover, .conv.on { background: var(--field); }
.conv .t { font-weight: 600; } .conv .p { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.unread { margin-left: auto; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px; }
.chat { display: flex; flex-direction: column; min-width: 0; }
.chat .head { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; gap: 10px; align-items: center; }
.chat .list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 70%; padding: 10px 15px; border-radius: 20px; line-height: 1.4; animation: fadeUp .2s ease both; word-wrap: break-word; }
.bubble.me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; background: var(--field); border-bottom-left-radius: 6px; }
.bubble img { max-width: 260px; border-radius: 14px; }
.meta { font-size: 10px; color: var(--faint); margin: 0 8px; } .meta.me { align-self: flex-end; }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.composer input[type=text] { flex: 1; height: 44px; border-radius: 22px; background: var(--field); border: 0; padding: 0 16px; outline: none; }

/* Feed & groupes */
.post { padding: 18px 0; border-bottom: 1px solid var(--line); animation: fadeUp .35s ease both; }
.post .who { display: flex; gap: 12px; align-items: center; }
.post .ph { width: 100%; max-height: 520px; object-fit: cover; border-radius: 24px; margin-top: 12px; }
.post .acts { display: flex; gap: 18px; margin-top: 10px; color: var(--muted); font-weight: 500; }
.group { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 22px; box-shadow: 0 4px 12px rgba(0,0,0,.05); margin-bottom: 10px; }
.tile { width: 54px; height: 54px; border-radius: 16px; background: var(--field); display: grid; place-items: center; font-family: var(--display); font-size: 20px; flex: none; }
.tile.sm { width: 40px; height: 40px; font-size: 15px; border-radius: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; padding: 12px; padding-bottom: 90px; }
  .side { position: fixed; top: auto; bottom: 10px; left: 10px; right: 10px; z-index: 50; padding: 8px; border-radius: 30px; }
  .side img.logo, .side .btn { display: none; }
  .nav { display: flex; justify-content: space-around; } .nav button { width: auto; font-size: 12px; padding: 10px 8px; margin: 0; }
  .landing { grid-template-columns: 1fr; } .landing .card { margin: 16px; padding: 26px; }
  .msgs { grid-template-columns: 1fr; } .msgs.open .conv-list { display: none; } .msgs:not(.open) .chat { display: none; }
  .panel { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
