/* Page du chat (/discuter/) — interface du prototype telrose aux couleurs du site.
   Les identifiants viennent de assets/chat/app.js. */

[hidden] { display: none !important; }

/* Boutons du prototype */
.chat-hotesse .btn, #shop .btn { border: 0; border-radius: 999px; padding: 13px 26px; font: inherit; font-weight: 700; cursor: pointer; }
.chat-hotesse .btn:disabled { opacity: .6; cursor: wait; }
#call { background: var(--rose); color: var(--rose-ink); box-shadow: 0 8px 28px -10px rgba(255, 79, 139, .75); }
#call:hover { background: var(--rose-2); }
#hangup { background: transparent; color: var(--err); border: 1px solid var(--err); }
.chat-hotesse .link, #shop .link { background: none; border: 0; color: var(--doux); font: inherit; font-size: .9rem; text-decoration: underline; cursor: pointer; padding: 0; }
.chat-hotesse .actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 0; }
.chat-hotesse .actions .link { margin-left: auto; }
.in-call .chat-hotesse .actions .link { display: none; }

/* Porte-monnaie */
#wallet { display: flex; align-items: center; gap: 12px; font-size: .95rem; color: var(--doux); font-variant-numeric: tabular-nums; background: var(--velours); border: 1px solid var(--trait); border-radius: 999px; padding: 6px 8px 6px 16px; }
#wallet strong { color: #fff; font-size: 1.1rem; }
#wallet.low strong { color: var(--err); }
#user-email { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#recharge { background: var(--rose); color: var(--rose-ink); padding: 7px 16px; font-size: .9rem; }

#test-banner { border: 1px dashed var(--rose); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; font-size: .88rem; color: var(--doux); }
#test-banner strong { color: var(--rose-2); }

/* Inscription / connexion */
#auth { background: var(--velours); border: 1px solid var(--trait); border-radius: 20px; padding: 22px 24px; max-width: 520px; }
/* Deux grands choix côte à côte : celui en cours est plein (rose), l'autre est un simple cadre */
.auth-choix { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.auth-choix button { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; background: var(--nuit); border: 1px solid var(--trait); border-radius: 14px; padding: 12px 14px; color: var(--doux); font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.auth-choix button strong { color: var(--texte); font-size: 1rem; }
.auth-choix button span { font-size: .8rem; line-height: 1.3; }
.auth-choix button:hover { border-color: var(--doux); }
.auth-choix button:focus-visible { outline: 2px solid var(--rose-2); outline-offset: 2px; }
.auth-choix button[aria-selected="true"] { background: var(--rose); border-color: var(--rose); color: var(--rose-ink); box-shadow: 0 10px 26px -14px rgba(255, 79, 139, .9); cursor: default; }
.auth-choix button[aria-selected="true"] strong { color: var(--rose-ink); }
#auth.mode-login #auth-form { border-left: 3px solid var(--doux); padding-left: 14px; }
#auth.mode-register #auth-form { border-left: 3px solid var(--rose); padding-left: 14px; }
#auth-form { display: flex; flex-direction: column; gap: 6px; }
#auth-form > label:not(.consent) { font-size: .9rem; color: var(--doux); margin-top: 8px; }
#auth-form input[type="email"], #auth-form input[type="password"] { background: var(--nuit); color: var(--texte); font: inherit; border: 1px solid var(--trait); border-radius: 12px; padding: 12px 14px; }
#auth-form .btn { background: var(--rose); color: var(--rose-ink); align-self: flex-start; margin-top: 8px; }
#auth-offer { margin: 0 0 4px; color: var(--ok); font-size: .95rem; }
.hint { margin: 0; font-size: .8rem; color: var(--pale); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; margin: 12px 0 6px; cursor: pointer; color: var(--doux); }
.consent input { margin-top: 4px; accent-color: var(--rose); width: 16px; height: 16px; flex: none; }
.in-call .chat-cadre .consent { display: none; }

/* Choix du mode : deux grands boutons Écrire / Appeler (remplace la case « Mode texte ») */
.mode-choix { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; }
.mode-choix button { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left;
  background: var(--nuit); border: 1px solid var(--trait); border-radius: 14px; padding: 12px 14px; color: var(--doux); font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.mode-choix svg { grid-row: span 2; width: 26px; height: 26px; color: var(--rose-2); }
.mode-choix strong { color: var(--texte); font-size: 1.05rem; }
.mode-choix span { font-size: .8rem; line-height: 1.3; }
.mode-choix button:hover { border-color: var(--doux); }
.mode-choix button:focus-visible { outline: 2px solid var(--rose-2); outline-offset: 2px; }
.mode-choix button[aria-checked="true"] { background: var(--rose); border-color: var(--rose); color: var(--rose-ink); box-shadow: 0 10px 26px -14px rgba(255, 79, 139, .9); cursor: default; }
.mode-choix button[aria-checked="true"] strong, .mode-choix button[aria-checked="true"] svg { color: var(--rose-ink); }
.in-call #mode-row { display: none; }

/* Choix de l'hôtesse */
#personas { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
#personas.locked { opacity: .55; pointer-events: none; }
.persona { background: var(--velours); border: 1px solid var(--trait); border-radius: 16px; color: inherit; padding: 14px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font: inherit; }
.persona:hover { border-color: var(--doux); }
.persona.selected { border-color: var(--rose); box-shadow: 0 0 0 1px var(--rose) inset, 0 12px 30px -18px rgba(255, 79, 139, .9); }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--trait); display: grid; place-items: center; font-family: var(--serif); font-style: italic; font-size: 1.5rem; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; }
.persona.selected .avatar { background: var(--rose); color: var(--rose-ink); }
.pname { font-weight: 600; }
.ptag { font-size: .78rem; color: var(--doux); text-align: center; line-height: 1.3; }

/* Conversation */
.chat-cadre { background: var(--velours); border: 1px solid var(--trait); border-radius: 20px; padding: 20px 22px; }
#rates { font-size: .84rem; color: var(--pale); margin: 0 0 16px; }
.in-call #rates { display: none; }
#timer { font-variant-numeric: tabular-nums; color: var(--doux); visibility: hidden; }
.in-call #timer { visibility: visible; }
.status { margin: 14px 0 0; min-height: 1.5em; color: var(--doux); }
.status.ok { color: var(--ok); }
.status.error { color: var(--err); }
#diag { display: none; align-items: center; gap: 10px; margin-top: 14px; font-size: .8rem; color: var(--doux); font-variant-numeric: tabular-nums; }
.in-call #diag { display: flex; }
.text-mode #diag, .text-mode #timer { display: none; }
.meter { width: 90px; height: 6px; border-radius: 3px; background: var(--trait); overflow: hidden; flex: none; }
#level { height: 100%; width: 0; background: var(--ok); }
#log { margin-top: 16px; max-height: 340px; overflow-y: auto; font-size: .98rem; border-top: 1px solid var(--trait); padding-top: 14px; }
.text-mode #log { max-height: 480px; }
#log:empty { display: none; }
#log p { margin: 0 0 10px; }
#log .her { color: var(--texte); }
#log .me { color: var(--doux); font-style: italic; }
#typing { display: flex; gap: 5px; align-items: center; height: 1.5em; }
#typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--doux); animation: typing 1.2s infinite ease-in-out; }
#typing span:nth-child(2) { animation-delay: .15s; }
#typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { #typing span { animation: none; opacity: .7; } }
#chat { display: none; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.in-call #chat { display: flex; }
#chat-input { flex: 1 1 180px; min-width: 0; background: var(--nuit); color: var(--texte); font: inherit; border: 1px solid var(--trait); border-radius: 999px; padding: 12px 18px; }
#chat-input::placeholder { color: var(--pale); }
#chat-send { background: var(--trait); color: var(--texte); padding: 12px 20px; }
/* Fin d'un appel vocal : à la place de la zone de saisie, sous la conversation (visible sans remonter sur mobile) */
#apres-appel { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--trait); }
#apres-appel p { margin: 0 0 10px; color: var(--doux); }
#apres-appel .actions { display: flex; flex-wrap: wrap; gap: 10px; }
#rappeler { background: var(--rose); color: var(--rose-ink); }
#continuer-ecrit { background: transparent; color: var(--rose-2); border: 1px solid var(--rose); }
#chat-continue { background: transparent; color: var(--rose-2); border: 1px solid var(--rose); padding: 12px 20px; }

/* Boutique de crédits */
dialog#shop { background: var(--velours); color: var(--texte); border: 1px solid var(--trait); border-radius: 20px; padding: 24px; width: min(560px, calc(100vw - 32px)); }
dialog#shop::backdrop { background: rgba(10, 5, 10, .8); backdrop-filter: blur(6px); }
#shop h2 { margin: 0 0 6px; font-size: 1.35rem; }
#shop-message { margin: 0 0 18px; color: var(--doux); }
#packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.pack { position: relative; background: var(--nuit); border: 1px solid var(--trait); border-radius: 14px; color: inherit; font: inherit; cursor: pointer; padding: 24px 8px 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pack:hover { border-color: var(--doux); }
.pack.featured { border-color: var(--rose); }
.pack:disabled { opacity: .6; cursor: wait; }
.badge { position: absolute; top: -10px; background: var(--rose); color: var(--rose-ink); font-size: .7rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.pk-name { color: var(--doux); font-size: .85rem; }
.pk-credits { font-weight: 600; }
.pk-price { font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.demo { font-size: .8rem; color: var(--doux); margin: 0 0 8px; }
#shop .status { margin: 0 0 8px; min-height: 0; }
@media (max-width: 480px) { #packs { grid-template-columns: 1fr; } }

/* Photos et vidéos envoyées par l'hôtesse */
.media-msg { position: relative; width: min(320px, 100%); margin: 4px 0 14px; border-radius: 16px; overflow: hidden; border: 1px solid var(--trait);
  background: radial-gradient(120% 90% at 30% 15%, rgba(255, 79, 139, .55), transparent 60%), linear-gradient(160deg, #3a1630, #160b14);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.media-vue { display: block; width: 100%; height: auto; max-height: 460px; object-fit: contain; background: #0d070c; -webkit-user-drag: none; }
canvas.media-vue { aspect-ratio: auto; }
.media-voile { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px;
  background: linear-gradient(transparent 35%, rgba(18, 10, 17, .85)); }
.media-type { font-size: .9rem; color: #fff; text-align: center; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.media-voir { background: var(--rose); color: var(--rose-ink); padding: 10px 20px; font-size: .95rem; }
.media-voir:hover { background: var(--rose-2); }
.media-msg.ouvert { border-color: rgba(255, 79, 139, .5); }

/* ---------- Page de chat d'une hôtesse : profil à gauche, conversation à droite ---------- */
.chat-hotesse { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: clamp(20px, 4vw, 44px); align-items: start; padding: 26px 0 20px; }
@media (max-width: 920px) { .chat-hotesse { grid-template-columns: 1fr; } }

.profil { --h: 340; position: sticky; top: 90px; background: var(--velours); border: 1px solid var(--trait); border-radius: 22px; overflow: hidden;
  box-shadow: 0 24px 60px -34px hsl(var(--h) 90% 60% / .9); }
@media (max-width: 920px) { .profil { position: static; } }
.profil-portrait { position: relative; aspect-ratio: 4 / 4.2; overflow: hidden; background:
  radial-gradient(120% 90% at 30% 15%, hsl(var(--h) 85% 62% / .95), transparent 60%),
  radial-gradient(90% 80% at 85% 90%, hsl(calc(var(--h) + 40) 70% 45% / .9), transparent 65%),
  linear-gradient(160deg, hsl(var(--h) 45% 22%), hsl(calc(var(--h) + 25) 40% 12%)); }
.profil-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; display: block; }
.profil-portrait::after { content: ""; position: absolute; inset: auto 0 0; height: 40%; background: linear-gradient(transparent, rgba(27, 15, 25, .95)); }
.profil-corps { position: relative; z-index: 1; padding: 0 20px 20px; margin-top: -48px; }
.profil h1 { font-size: 2.2rem; margin: 0 0 4px; }
.profil h1 .age { font-family: var(--sans); font-size: 1rem; font-weight: 400; color: var(--doux); }
.profil .accroche { color: var(--or); margin: 0 0 6px; }
.profil .intro { color: var(--doux); font-size: .95rem; margin: 0 0 14px; }
@media (max-width: 920px) {
  .profil { display: grid; grid-template-columns: 140px 1fr; }
  .profil-portrait { aspect-ratio: auto; min-height: 100%; }
  .profil-portrait::after { display: none; }
  .profil-corps { margin-top: 0; padding: 14px 16px; }
  .profil h1 { font-size: 1.6rem; }
  .profil .intro, .galerie { display: none; }
}

.galerie { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 14px; }
.galerie-vignette { padding: 0; border: 1px solid var(--trait); border-radius: 12px; overflow: hidden; cursor: zoom-in; background: none; aspect-ratio: 1; }
.galerie-vignette img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; display: block; transition: transform .2s ease; }
.galerie-vignette:hover img { transform: scale(1.05); }

.prives { border-top: 1px solid var(--trait); padding-top: 12px; margin-top: 4px; }
.prives-titre { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 8px; font-weight: 600; font-size: .95rem; }
.prives-titre span { color: var(--rose-2); font-weight: 400; font-size: .85rem; }
.prives-grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.prive { aspect-ratio: 3 / 4; border-radius: 10px; background: linear-gradient(160deg, hsl(var(--h) 45% 30%), #160b14) center / cover no-repeat;
  display: grid; place-items: center; font-size: 1.4rem; position: relative; overflow: hidden; }
.prive::after { content: "🔒"; position: absolute; right: 6px; bottom: 4px; font-size: .8rem; opacity: .85; }
.prives-note { color: var(--pale); font-size: .82rem; margin: 8px 0 0; }
.profil-fiche { margin: 14px 0 0; font-size: .9rem; }

.conversation { min-width: 0; }
.conv-tete { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.conv-tete .surtitre { margin: 0; }
.auth-accroche { margin: 0 0 14px; font-family: var(--serif); font-size: 1.25rem; color: #fff; }
.conversation #auth { max-width: none; }
.conversation .chat-cadre { min-height: 320px; }
.conversation #log { max-height: 58vh; }
.text-mode .conversation #log { max-height: 62vh; }
.encart-ia.mini { margin-top: 16px; font-size: .84rem; }

/* Autres hôtesses : bande d'avatars */
.ronds { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.ronds a { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--texte); padding: 12px 6px; border: 1px solid var(--trait); border-radius: 16px; background: var(--velours); text-align: center; }
.ronds a:hover { border-color: hsl(var(--h) 80% 60%); color: #fff; }
.ronds .pastille { width: 58px; height: 58px; font-size: 1.5rem; }
.rond-nom { font-weight: 600; }
.rond-tag { font-size: .75rem; color: var(--doux); line-height: 1.3; }

/* Visionneuse des photos publiques */
.visionneuse { max-width: min(92vw, 900px); max-height: 92vh; padding: 10px; background: var(--velours); border: 1px solid var(--trait); border-radius: 16px; color: var(--texte); text-align: center; }
.visionneuse::backdrop { background: rgba(8, 4, 8, .9); }
.visionneuse img { max-width: 100%; max-height: calc(92vh - 70px); display: block; margin: 0 auto 8px; border-radius: 10px; }

/* Mobile : profil compact et barre des crédits sur deux lignes */
@media (max-width: 920px) {
  .profil .etiquette-ia { display: none; }
  .profil .en-ligne { top: 8px; right: 8px; left: auto; }
}
@media (max-width: 600px) {
  .conv-tete { flex-direction: column; align-items: stretch; }
  #wallet { flex-wrap: wrap; justify-content: space-between; border-radius: 16px; padding: 8px 12px; row-gap: 6px; }
  #user-email { flex: 1 1 100%; max-width: none; font-size: .85rem; }
  .galerie { grid-template-columns: repeat(4, 1fr); }
}

/* Boutique : renonciation et historique des achats */
#shop .consent { margin: 4px 0 8px; }
#shop .consent.a-cocher { outline: 2px solid var(--rose); outline-offset: 4px; border-radius: 8px; }
#shop .hint { margin: 0 0 10px; }
#shop-history { margin: 6px 0 12px; font-size: .9rem; }
#shop-history summary { cursor: pointer; color: var(--doux); }
table.historique { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .85rem; }
table.historique td { padding: 6px 4px; border-bottom: 1px solid var(--trait); }
table.historique td:nth-child(3), table.historique td:nth-child(4) { white-space: nowrap; text-align: right; }

/* Ambiance de la conversation et suggestions cliquables */
.ambiance { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 4px; }
.ambiance-titre, .suggestions-titre { font-size: .82rem; color: var(--pale); text-transform: uppercase; letter-spacing: .08em; }
.ambiance-choix { font: inherit; font-size: .88rem; padding: 6px 14px; border-radius: 999px; cursor: pointer; background: transparent; color: var(--doux); border: 1px solid var(--trait); }
.ambiance-choix[aria-pressed="true"] { background: rgba(255, 79, 139, .16); color: #fff; border-color: var(--rose); }
#amb-cru[aria-pressed="true"] { background: linear-gradient(135deg, #ff4f8b, #c2336b); color: var(--rose-ink); border-color: transparent; font-weight: 700; }
.ambiance-aide { flex: 1 1 100%; font-size: .82rem; color: var(--pale); }
.suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0; }
.suggestion { font: inherit; font-size: .88rem; padding: 7px 14px; border-radius: 999px; cursor: pointer; background: var(--nuit); color: var(--texte); border: 1px dashed var(--rose); }
.suggestion:hover { background: rgba(255, 79, 139, .14); }