/* ===== Contentome — styles partagés (chrome + utilitaires) ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0d0d0d;
  --card: #171717;
  /* ===== Couleurs de marque — CENTRALISÉES ICI =====
     Pour changer TOUTE l'app de couleur, il suffit de modifier ces lignes.
       --accent      : le violet plein (couleur primaire)
       --accent-rgb  : les mêmes canaux R,G,B (pour les fonds/bordures translucides)
       --accent-2    : la nuance claire du dégradé des boutons
       --accent-soft : la nuance texte sur fond translucide (tags, pastilles)
       --accent-nav  : violet plus vif pour l'onglet actif de la navbar (ressort sur le verre)
       --gold        : 3e couleur, EN PETITE TOUCHE uniquement (étoiles de note, accents Premium) */
  --accent: #7A4FC9;
  --accent-rgb: 122, 79, 201;
  --accent-2: #9A73DE;
  --accent-2-rgb: 154, 115, 222;
  --accent-soft: #CBB4F0;
  --accent-nav: #A876EE;
  --gold: #DDB65E;
  --gold-rgb: 221, 182, 94;   /* mêmes canaux R,G,B que --gold, pour les fonds/bordures translucides */
  --accent-bg: #3D2C63;       /* teinte FONCÉE du primaire : fond des ronds d'avatar (suit le thème) */
  --muted: #9a9a9a;
  --line: #1f1f1f;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
html, body { height: 100%; }
/* La coquille ne doit JAMAIS défiler : le téléphone reste fixe.
   Sinon, un focus/scroll dans une sous-page décale toute l'interface (navbar plus haute, etc.). */
html, body { overflow: hidden; }
body { font-family: var(--font-sans); color: #fff; background: var(--bg); }

/* Scrollbars masquées partout */
.cm-scroll::-webkit-scrollbar, .screen-scroll::-webkit-scrollbar { display: none; }
.cm-scroll, .screen-scroll { scrollbar-width: none; }

/* ---------- Coquille (index.html) ---------- */
.stage {
  min-height: 100vh; display: flex; justify-content: center; align-items: center;
  background: radial-gradient(130% 90% at 50% 0%, #1c1320 0%, #0a0a0d 52%, #050506 100%);
}
.phone {
  width: 340px; height: 680px; position: relative;
  background: var(--bg); border-radius: 48px; border: 5px solid #0b0b0e;
  box-shadow:
    0 0 0 1.5px rgba(255,255,255,0.05),
    0 34px 80px -24px rgba(0,0,0,0.85),
    0 0 70px -12px rgba(var(--accent-rgb), 0.16);
  overflow: hidden; display: flex; flex-direction: column;
}
/* Dynamic Island */
.phone::before {
  content: ""; position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 88px; height: 24px; background: #000; border-radius: 14px; z-index: 60; pointer-events: none;
}
.statusbar {
  height: 42px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 24px 0; font-size: 12px; font-weight: 600; color: #f2f2f2;
}
.statusbar .ic { display: flex; gap: 6px; }
.view { flex: 1; width: 100%; border: 0; background: var(--bg); transition: opacity 0.3s ease; }

/* Barre du bas — « Liquid Glass » iOS 26, flottante AU-DESSUS du contenu.
   En absolute, l'iframe passe dessous : le contenu se voit (flouté) derrière. */
.navbar {
  position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 40;
  padding: 3px 6px;
  background: rgba(0,0,0,0.60);
  backdrop-filter: url(#cmLiquid);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 30px;
  box-shadow:
    0 16px 38px -10px rgba(0,0,0,0.55),
    inset 0 1px 1px rgba(255,255,255,0.28),
    inset 0 -10px 22px -12px rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: space-around;
  overflow: hidden;
}
/* Reflet liquide : sheen lumineux en haut, lueur radiale douce (iOS 26) */
.navbar::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.11) 0%, rgba(255,255,255,0.03) 22%, rgba(255,255,255,0) 46%),
    radial-gradient(130% 90% at 50% 0%, rgba(255,255,255,0.06), transparent 64%);
}
.nav-item {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; flex: 1; padding: 2px 0; border-radius: 16px;
  color: #fff; background: none; border: none; font-family: inherit;
  transition: color 0.3s ease, transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.nav-item i { font-size: 20px; transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1); }
.nav-item span { font-size: 9px; font-weight: 500; }
.nav-item:active { transform: scale(0.88); }
.nav-item.active { color: var(--accent-nav); }
.nav-item.active i { transform: translateY(-1px) scale(1.1); }
.nav-item.logger i { font-size: 22px; }

/* ---------- Page (dans l'iframe) ---------- */
.screen { height: 100%; display: flex; flex-direction: column; }
/* padding-bottom !important : place le contenu au-dessus de la navbar flottante,
   même quand une page redéfinit son propre padding (ex. .ac-scroll). */
.screen-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; padding-bottom: 92px !important; }
/* ---------- Publicité (prototype : emplacements FACTICES, masqués en Premium) ----------
   Bandeau « in-feed » inséré ENTRE deux sections d'une page (Accueil, Explorer, Social) ;
   + cartes sponsorisées dans les rangées de vidéos. Remplacés par AdMob au portage. */
.ad-inline {
  position: relative; display: flex; align-items: center; gap: 12px;
  background: #17171b; border: 1px solid rgba(255,255,255,0.09); border-radius: 14px;
  padding: 12px; margin-bottom: 20px;
}
.ad-inline .adi-tag { position: absolute; top: -7px; left: 12px; font-size: 8px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; color: #bbb; background: #2a2a2e; padding: 1px 6px; border-radius: 5px; }
.ad-inline .adi-ic { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; flex-shrink: 0; }
.ad-inline .adi-txt { flex: 1; min-width: 0; }
.ad-inline .adi-txt b { display: block; font-size: 13px; font-weight: 600; color: #fff; }
.ad-inline .adi-txt span { display: block; font-size: 11px; color: #9a9a9a; margin-top: 2px; line-height: 1.35; }
.ad-inline .adi-cta { flex-shrink: 0; font-size: 11px; font-weight: 600; color: #fff; background: var(--accent); border-radius: 9px; padding: 7px 12px; }

/* ---------- Utilitaires réutilisés ---------- */
.section-label {
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.cat-pill {
  flex-shrink: 0; border-radius: 20px; padding: 6px 14px;
  font-size: 12px; font-weight: 500; cursor: pointer; border: none; font-family: inherit;
}
.cat-pill.active { background: var(--accent); color: #fff; }
.cat-pill.inactive { background: #1a1a1a; color: var(--muted); }

/* Survol (PC) : léger zoom des cartes vidéo pour montrer celle qu'on pointe.
   @media (hover:hover) → ignoré sur écran tactile (pas d'état "survol" collé). */
@media (hover: hover) {
  .tr-card, .sg-card, .ex-card, .rel-card, .g-card,
  .result-card, .sub-new, .cat-tile {
    transition: transform 0.18s ease;
  }
  .tr-card:hover, .sg-card:hover, .ex-card:hover, .rel-card:hover, .g-card:hover { transform: scale(1.04); }
  .result-card:hover, .sub-new:hover, .cat-tile:hover { transform: scale(1.02); }
}

/* Glissement d'un sous-onglet à l'autre (clic ou swipe). La classe est retirée
   à la fin de l'animation pour ne pas gêner un défilement ultérieur. */
@keyframes cm-slide-next { from { transform: translateX(26px); opacity: .35; } to { transform: none; opacity: 1; } }
@keyframes cm-slide-prev { from { transform: translateX(-26px); opacity: .35; } to { transform: none; opacity: 1; } }
.cm-slide-next { animation: cm-slide-next 0.26s cubic-bezier(0.32,0.72,0,1); }
.cm-slide-prev { animation: cm-slide-prev 0.26s cubic-bezier(0.32,0.72,0,1); }

/* Stub "écran à venir" */
.coming-soon {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: #555; text-align: center; padding: 40px;
}
.coming-soon i { font-size: 42px; color: #333; }
.coming-soon p { font-size: 14px; }

/* ---------- Feuille de recherche (bottom sheet iOS) ---------- */
.sheet-backdrop {
  position: absolute; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.45);
  opacity: 0; pointer-events: none; transition: opacity 0.35s ease;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.search-sheet {
  position: absolute; left: 0; right: 0; top: 60px; bottom: 0; z-index: 101;
  background: rgba(22,22,25,0.96);
  -webkit-backdrop-filter: blur(30px) saturate(1.5); backdrop-filter: blur(30px) saturate(1.5);
  border-top: 1px solid rgba(255,255,255,0.09); border-radius: 28px 28px 0 0;
  box-shadow: 0 -18px 50px -10px rgba(0,0,0,0.6);
  transform: translateY(110%); transition: transform 0.42s cubic-bezier(0.32,0.72,0,1);
  display: flex; flex-direction: column; overflow: hidden;
}
.search-sheet.open { transform: translateY(0); }
.sheet-grab { width: 38px; height: 5px; border-radius: 3px; background: #3a3a3e; margin: 9px auto 4px; flex-shrink: 0; }
.sheet-search { display: flex; align-items: center; gap: 10px; padding: 8px 16px 12px; flex-shrink: 0; }
.sheet-search > i { font-size: 18px; color: var(--muted); flex-shrink: 0; }
.sheet-search input { flex: 1; min-width: 0; background: #1e1e22; border: 1.5px solid transparent; border-radius: 12px; padding: 10px 12px; color: #fff; font-size: 14px; outline: none; caret-color: var(--accent); font-family: inherit; }
.sheet-search input:focus { border-color: var(--accent); }
.sheet-search input::placeholder { color: #666; }
.sheet-cancel { background: none; border: none; color: var(--accent); font-size: 14px; cursor: pointer; font-family: inherit; flex-shrink: 0; }
.sheet-body { flex: 1; overflow-y: auto; padding: 0 16px 16px; }
.sheet-hist-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 2px 8px; }
.sheet-hist-head span { font-size: 13px; font-weight: 600; color: var(--muted); }
.sheet-hist-head button { background: none; border: none; color: var(--muted); font-size: 12px; cursor: pointer; font-family: inherit; }
.hist-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 0.5px solid #232326; cursor: pointer; }
.hist-row i.lead { font-size: 18px; color: #888; flex-shrink: 0; }
.hist-row .q { flex: 1; min-width: 0; font-size: 14px; color: #eaeaea; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-row i.del { font-size: 16px; color: #555; padding: 4px; flex-shrink: 0; }
.hist-row i.del:active { color: var(--accent); }
.sheet-empty { text-align: center; color: #5a5a5a; font-size: 13px; padding: 30px 0; }

/* Feuille « sélecteur » (amis / communautés) — réutilise .search-sheet */
.sheet-title { font-size: 13px; font-weight: 600; color: var(--muted); padding: 2px 18px 10px; flex-shrink: 0; }
.pick-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin: 3px 6px; border-radius: 18px; cursor: pointer; transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), background 0.18s ease; }
.pick-row:active { background: rgba(255,255,255,0.05); }
.pick-av { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 14px; position: relative; }
.pick-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.pick-av i { font-size: 20px; }
.pick-on { position: absolute; bottom: 1px; right: 1px; width: 11px; height: 11px; border-radius: 50%; background: #2ecc71; border: 2px solid #161619; }
.pick-info { flex: 1; min-width: 0; }
.pick-name { font-size: 14px; font-weight: 600; color: #fff; }
.pick-sub { font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-go { font-size: 18px; color: #555; flex-shrink: 0; }

/* Feuille multi-sélection (créer un groupe) — réutilise .search-sheet + .pick-row */
.multi-name { padding: 0 16px 10px; flex-shrink: 0; }
.multi-name input { width: 100%; background: #1e1e22; border: 1.5px solid transparent; border-radius: 12px; padding: 10px 12px; color: #fff; font-size: 14px; outline: none; caret-color: var(--accent); font-family: inherit; }
.multi-name input:focus { border-color: var(--accent); }
.multi-name input::placeholder { color: #666; }
/* Ami sélectionné (créer un groupe) : la ligne se colore en rouge et zoome légèrement.
   Pas de pastille, pas d'anneau, le nom reste blanc. */
.pick-row.sel { background: linear-gradient(135deg, rgba(var(--accent-2-rgb), 0.30), rgba(var(--accent-rgb), 0.22)); transform: scale(1.03); box-shadow: 0 6px 16px -10px rgba(var(--accent-rgb), 0.4); }
.multi-foot { padding: 10px 16px 14px; flex-shrink: 0; border-top: 1px solid rgba(255,255,255,0.06); }
.multi-confirm { width: 100%; height: 46px; border: none; border-radius: 14px; background: linear-gradient(135deg,var(--accent-2),var(--accent)); color: #fff; font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer; }
.multi-confirm:disabled { background: #1c1c1c; color: #555; cursor: default; }

/* ---------- Fiche vidéo (bottom sheet, quasi plein écran) ---------- */
.video-sheet {
  position: absolute; left: 0; right: 0; top: 34px; bottom: 0; z-index: 101;
  background: var(--bg); border-radius: 26px 26px 0 0;
  box-shadow: 0 -18px 50px -10px rgba(0,0,0,0.6);
  transform: translateY(110%); transition: transform 0.42s cubic-bezier(0.32,0.72,0,1);
  display: flex; flex-direction: column; overflow: hidden;
}
.video-sheet.open { transform: translateY(0); }
.vs-grab { width: 38px; height: 5px; border-radius: 3px; background: #3a3a3e; margin: 9px auto 6px; flex-shrink: 0; }
.video-frame { flex: 1; width: 100%; border: 0; background: var(--bg); }

/* ---------- Toast (message flottant) ---------- */
.cm-toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(10px); z-index: 350; background: rgba(40,40,44,0.96); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: #fff; font-size: 13px; font-weight: 500; padding: 10px 16px; border-radius: 14px; box-shadow: 0 12px 30px -8px rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.11); opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease; max-width: 80%; text-align: center; }
.cm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Menu d'un log (Modifier / Supprimer), partagé ---------- */
.lg-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.5); opacity: 0; transition: opacity 0.22s ease; }
.lg-backdrop.show { opacity: 1; }
.lg-sheet { position: fixed; left: 16px; right: 16px; bottom: 80px; z-index: 201; background: rgba(30,30,34,0.98); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.1); border-radius: 18px; overflow: hidden; transform: translateY(16px); opacity: 0; transition: transform 0.26s cubic-bezier(0.32,0.72,0,1), opacity 0.2s ease; }
.lg-sheet.show { transform: translateY(0); opacity: 1; }
.lg-sheet-title { font-size: 12px; color: var(--muted); padding: 13px 18px 11px; border-bottom: 0.5px solid #2f2f33; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-sheet button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 15px 18px; background: none; border: none; color: #eaeaea; font-size: 15px; font-family: inherit; cursor: pointer; text-align: left; }
.lg-sheet button + button { border-top: 0.5px solid #2f2f33; }
.lg-sheet button i { font-size: 20px; color: var(--muted); }
.lg-sheet button:active { background: #26262b; }
.lg-sheet button.danger, .lg-sheet button.danger i { color: #ff5a6a; }

/* ---------- Menu de réaction (appui long sur un message) ---------- */
.rx-backdrop { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.30); -webkit-backdrop-filter: blur(13px) saturate(1.2); backdrop-filter: blur(13px) saturate(1.2); opacity: 0; transition: opacity 0.24s ease; }
.rx-backdrop.show { opacity: 1; }
/* Le message pointé, mis en clair et légèrement zoomé */
.rx-bubble { z-index: 302; margin: 0 !important; opacity: 0; transform: scale(0.97); transform-origin: center; transition: transform 0.26s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s ease; box-shadow: 0 20px 46px -12px rgba(0,0,0,0.75); pointer-events: none; }
.rx-bubble.show { opacity: 1; transform: scale(1.06); }
/* Barre d'émojis */
.rx-bar { position: fixed; z-index: 303; display: flex; align-items: center; gap: 3px; padding: 6px; border-radius: 27px; background: rgba(34,34,38,0.92); -webkit-backdrop-filter: blur(22px) saturate(1.7); backdrop-filter: blur(22px) saturate(1.7); border: 1px solid rgba(255,255,255,0.13); box-shadow: 0 16px 36px -10px rgba(0,0,0,0.6); transform: translateY(10px) scale(0.9); opacity: 0; transform-origin: center bottom; transition: transform 0.26s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s ease; }
.rx-bar.show { transform: translateY(0) scale(1); opacity: 1; }
.rx-emo { width: 39px; height: 39px; border-radius: 50%; border: none; background: none; font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.14s ease, background 0.14s ease; }
@media (hover: hover) { .rx-emo:hover { background: rgba(255,255,255,0.09); transform: scale(1.15); } }
.rx-emo:active { transform: scale(1.35); }
.rx-plus { color: #fff; background: rgba(255,255,255,0.09); }
.rx-plus i { font-size: 20px; }
/* Champ INVISIBLE : sert uniquement à faire monter le clavier émoji de l'appareil (bouton +).
   Pas display:none (sinon pas de focus possible), mais opacité 0 → rien à l'écran. */
.rx-hidden-input { position: fixed; left: 50%; bottom: 42%; width: 1px; height: 1px; opacity: 0; border: none; padding: 0; margin: 0; background: none; color: transparent; caret-color: transparent; font-size: 16px; pointer-events: none; z-index: 304; }

/* ---------- Splash d'ouverture + écran de chargement ---------- */
.boot {
  position: absolute; inset: 0; z-index: 200; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  transition: opacity 0.35s ease;
}
.boot-logo { font-size: 30px; font-weight: 600; color: #fff; display: inline-flex; align-items: baseline; }
.boot-logo .play { display: inline-block; width: 0; height: 0; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-left: 17px solid var(--accent); margin: 0 2px; transform: translateY(2px); border-radius: 3px; }

/* Splash (A) — pulsation du triangle */
#splash .boot-logo { animation: cm-bootfade 0.4s ease both; }
#splash .play { animation: cm-pulse 1.1s ease-in-out infinite; }
@keyframes cm-bootfade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cm-pulse { 0%, 100% { transform: translateY(2px) scale(1); } 50% { transform: translateY(2px) scale(1.4); } }

/* Chargement (B) — rebond du logo + barre qui se remplit */
#loading .boot-logo { animation: cm-bootin 0.6s cubic-bezier(0.34,1.56,0.64,1) both; }
@keyframes cm-bootin { 0% { opacity: 0; transform: scale(0.6); } 60% { transform: scale(1.12); } 100% { opacity: 1; transform: scale(1); } }
.boot-bar { width: 120px; height: 4px; background: #2a2a2a; border-radius: 2px; overflow: hidden; }
.boot-bar > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 2px; }
#loading .boot-bar > i { animation: cm-bootbar 0.95s ease-in-out 0.2s forwards; }
@keyframes cm-bootbar { to { width: 100%; } }

/* ---------- Écran de connexion ---------- */
.auth { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 30px 26px; text-align: center; background: radial-gradient(120% 75% at 50% 0%, rgba(var(--accent-rgb), 0.14), transparent 58%); }
.auth-logo { font-size: 31px; font-weight: 600; display: flex; align-items: baseline; }
.auth-logo .play { display: inline-block; width: 0; height: 0; border-top: 9px solid transparent; border-bottom: 9px solid transparent; border-left: 15px solid var(--accent); margin: 0 2px; transform: translateY(2px); border-radius: 3px; }
.auth-tag { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.auth-card { background: rgba(23,23,26,0.68); -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5); border: 1px solid rgba(255,255,255,0.07); border-radius: 26px; padding: 22px 18px; width: 100%; box-shadow: 0 22px 55px -22px rgba(0,0,0,0.75), inset 0 1px 0 rgba(255,255,255,0.06); }
.auth-h { font-size: 17px; font-weight: 600; margin: 0 0 6px; }
.auth-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 16px; line-height: 1.5; }
.auth-btn { width: 100%; height: 50px; border: none; border-radius: 16px; background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 10px 24px -8px rgba(var(--accent-rgb), 0.6); transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1); }
.auth-btn:active { transform: scale(0.97); }
.auth-btn i { font-size: 20px; }
.auth-note { font-size: 10.5px; color: #666; margin: 12px 0 0; line-height: 1.4; }
.auth-skip { background: none; border: none; color: var(--muted); font-size: 12px; cursor: pointer; text-decoration: underline; }
.auth-warn { font-size: 11px; color: #e0a020; max-width: 280px; line-height: 1.4; margin: 0; }
