/* Écrans de l'app (PWA) */
.app { max-width: 520px; margin: 0 auto; padding: 0 16px calc(110px + var(--safe-bottom)); min-height: 100dvh; }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0 12px;
}
.topbar::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%); background: linear-gradient(var(--bg) 70%, transparent); z-index: -1; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-title); font-weight: 800; font-size: 19px; line-height: 1; letter-spacing: -.03em; color: var(--text); text-decoration: none; }
.logo .logo-name { display: block; transform: translateY(-2px); }
.logo .logo-mark { width: 28px; height: 28px; border-radius: 9px; display: block; }
.logo .eyes { display: inline-block; animation: float 3s ease-in-out infinite; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--card); display: grid; place-items: center;
  font-size: 19px; cursor: pointer; position: relative; text-decoration: none;
}
.icon-btn .dot { position: absolute; top: 6px; right: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--lime); border: 2px solid var(--card); }

.page-title { font-size: 34px; margin: 8px 0 6px; }
.page-sub { color: var(--muted); margin-bottom: 22px; }
.section-title { font-family: var(--font-title); font-size: 19px; margin: 26px 0 12px; display: flex; align-items: center; justify-content: space-between; }

/* Barre du bas */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-bottom)); z-index: 30;
  display: flex; align-items: center; gap: 6px; padding: 7px; border-radius: 999px;
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(255, 46, 116, .20);
}
.tabbar a {
  display: grid; place-items: center; width: 56px; height: 48px; border-radius: 999px; text-decoration: none;
  font-size: 21px; color: var(--muted); transition: background .2s;
}
.tabbar a.on { background: var(--card-2); }
.tabbar a.plus { width: 64px; background: var(--accent); color: var(--on-accent); font-size: 28px; font-weight: 300; box-shadow: 0 8px 20px rgba(255, 46, 116, .4); }

/* Stories des profils suivis */
.stories { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 10px; margin: 0 -16px; padding-left: 16px; scrollbar-width: none; }
.stories::-webkit-scrollbar { display: none; }
.story { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; width: 70px; flex: none; }
.story span { font-size: 12px; font-weight: 600; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story .add { width: 63px; height: 63px; border-radius: 50%; border: 2px dashed var(--dim); display: grid; place-items: center; font-size: 26px; color: var(--muted); }
.story .count { position: absolute; }
.story-wrap { position: relative; }
.story-wrap .pill { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); background: var(--grad); color: var(--on-accent); font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; border: 2px solid var(--bg); }

/* Événements */
.day-label { font-size: 13px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; margin: 22px 4px 10px; }
.event {
  display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--card); border-radius: 20px;
  margin-bottom: 8px; border: 1px solid var(--line); text-decoration: none;
}
.event.unread { border-color: rgba(255, 46, 116, .45); box-shadow: 0 0 0 1px rgba(255, 46, 116, .18), var(--shadow); }
.event .avatars { position: relative; width: 56px; height: 48px; flex: none; }
.event .avatars .avatar { position: absolute; width: 40px; height: 40px; }
.event .avatars .avatar:first-child { top: 0; left: 0; }
.event .avatars .avatar:last-child { bottom: 0; right: 0; }
.event .txt { flex: 1; min-width: 0; font-size: 15px; line-height: 1.35; }
.event .txt b { font-weight: 700; }
.event .time { font-size: 12px; color: var(--dim); margin-top: 2px; }
.event .ico { font-size: 20px; flex: none; }
.event.locked .txt { filter: none; }
.lock-line { display: inline-block; height: 12px; width: 120px; border-radius: 6px; background: var(--card-2); vertical-align: middle; }

/* Liens dans une ligne d'événement : même couleur que le texte (pas l'accent rose) */
.ulink, .elink { cursor: pointer; color: inherit; text-decoration: none; }
.ulink > b, .elink > b { font-weight: 700; }
.ulink:hover > b, .ulink:focus-visible > b, .elink:hover > b, .elink:focus-visible > b { text-decoration: underline; }
.ulink:focus-visible, .elink:focus-visible { outline: none; }
.event a.avatars { display: block; }

/* Fiche profil */
.profile-head { text-align: center; padding: 10px 0 6px; }
.profile-head .avatar-ring { margin: 0 auto 12px; }
.profile-head h1 { font-size: 28px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.stat { background: var(--card); border-radius: 20px; padding: 14px; text-align: center; border: 1px solid var(--line); }
.stat b { display: block; font-family: var(--font-title); font-size: 26px; }
.stat small { color: var(--muted); font-size: 13px; }
.spark { width: 100%; height: 70px; display: block; }
.tabs { display: flex; gap: 6px; margin: 22px 0 12px; }
.tabs button { border: 0; background: var(--card); color: var(--muted); padding: 9px 16px; border-radius: 999px; font-weight: 700; cursor: pointer; font-size: 14px; }
.tabs button.on { background: var(--grad); color: var(--on-accent); }
.row { display: flex; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.row:last-child { border: 0; }
.row .avatar { width: 42px; height: 42px; }
.row .grow { flex: 1; min-width: 0; }
.row .grow b { display: block; overflow: hidden; text-overflow: ellipsis; }

/* Répartition meufs/mecs des abonnements (façon The Ick) */
.gcard { padding: 16px; }
.gbar { display: flex; align-items: center; gap: 12px; border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; width: 100%; border: 0; cursor: pointer; font: inherit; color: inherit; text-align: left; -webkit-tap-highlight-color: transparent; transition: transform .12s ease, filter .15s; }
.gbar:active { transform: scale(.985); filter: brightness(.97); }
.gchev { color: var(--dim); flex: none; margin-left: 2px; display: flex; align-items: center; }
.gbar.f { background: rgba(255, 46, 116, .12); }
.gbar.m { background: rgba(59, 91, 255, .12); }
.gbar:last-of-type { margin-bottom: 0; }
.gemo { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: var(--card); flex: none; box-shadow: var(--shadow-sm); }
.glabel { flex: 1; font-size: 17px; }
.glabel b { font-family: var(--font-title); font-size: 24px; margin-right: 2px; }
.gstack { display: flex; align-items: center; flex: none; }
.gav { width: 30px; height: 30px; border-radius: 50%; margin-left: -10px; border: 2px solid var(--card); background: var(--card-2); overflow: hidden; flex: none; display: grid; place-items: center; }
.gav:first-child { margin-left: 0; }
.gavimg { width: 100%; height: 100%; object-fit: cover; border: 0; border-radius: 50%; }
.gav.locked { background: repeating-linear-gradient(45deg, var(--card-2), var(--card-2) 4px, #f6d4e1 4px, #f6d4e1 8px); }
.gav.more { font-size: 11px; font-weight: 800; color: var(--muted); }
.gbar-lock { display: block; text-align: center; margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--accent); text-decoration: none; }

/* Liste des abonnements d'un genre (modal) */
.follow-list { max-height: 56vh; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.follow-list .flink { text-decoration: none; }
.follow-list .flink:active { background: var(--card-2); }
.flink-ext { color: var(--accent); flex: none; display: flex; align-items: center; }

/* Icônes Lucide inline */
.ic { display: block; }
.icon-btn .ic { color: var(--text); }

/* Sélecteur de langue */
.lang-sel {
  border: 1.5px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 9px 30px 9px 14px; font-weight: 700; font-size: 14px; color: var(--text); cursor: pointer;
  -webkit-appearance: none; appearance: none; flex: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%236a6470' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}

/* Switch */
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--card-2); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--lime); }
.switch input:checked + span::before { transform: translateX(20px); }

/* Emoji picker */
.emojis { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.emojis button { width: 44px; height: 44px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); font-size: 22px; cursor: pointer; }
.emojis button.on { border-color: var(--lime); background: var(--lime-dim); }

/* Paywall */
.plan {
  position: relative; display: block; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 12px; cursor: pointer; transition: border-color .2s;
}
.plan.on { border-color: var(--lime); box-shadow: var(--shadow); }
.plan .price { font-family: var(--font-title); font-size: 28px; font-weight: 800; }
.plan .tag { position: absolute; top: -11px; right: 16px; }
.perks { list-style: none; margin: 18px 0 24px; }
.perks li { padding: 8px 0; display: flex; gap: 12px; align-items: center; font-weight: 500; }
.perks li span { font-size: 20px; }

/* Bandeau upgrade */
.upsell { display: flex; gap: 12px; align-items: center; background: var(--accent-dim); border: 1px solid rgba(255, 46, 116, .3); border-radius: 20px; padding: 14px; text-decoration: none; margin: 10px 0; }
.upsell .grow { flex: 1; font-size: 14px; }

/* Écran d'accueil (non connecté) */
.welcome { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 30px 0; }
.welcome h1 { font-size: 44px; margin-bottom: 10px; }

/* Vide */
.empty { text-align: center; padding: 40px 10px; }
.empty .big { font-size: 56px; margin-bottom: 10px; animation: float 3s ease-in-out infinite; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 60; display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(4px); }
.modal { background: var(--bg-2); width: 100%; max-width: 520px; border-radius: 28px 28px 0 0; padding: 24px 18px calc(24px + var(--safe-bottom)); animation: rise .35s cubic-bezier(.2, 1, .4, 1); max-height: 90dvh; overflow: auto; }
.modal h2 { margin-bottom: 8px; }
.steps { counter-reset: s; list-style: none; margin: 16px 0; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.steps li::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--grad); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; font-size: 13px; }

.list-links a { display: flex; justify-content: space-between; align-items: center; padding: 15px 4px; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.list-links a:last-child { border: 0; }

/* Carte partageable (aperçu) */
.cardwrap { display: flex; justify-content: center; }
.cardimg { max-height: 56vh; width: auto; max-width: 100%; border-radius: 18px; display: block; box-shadow: var(--shadow); }

/* Confettis */
.confetti { position: fixed; top: -10px; z-index: 90; width: 9px; height: 14px; border-radius: 3px; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .8; } }
