/* LE CHAT D'ALPHA DANS UNE FENETRE (Lionel, 09/10 -- maquette_orbe_chat validee : « je voudrais la meme [maniere
   de chat] pour Alpha, j'aime pas trop la barre en bas : le bouton chat, et quand tu appuies dessus la fenetre de
   chat qui apparait ; quand j'appuie encore, ca se referme et ca redevient un bouton » ; « le texte ne vient plus
   sur l'ecran, mais il apparait dans le chat, donc je peux le voir si je veux »).
   Memes ids, meme code (chat.js) : seule l'apparence change, comme les fenetres « Parler a ... » des autres pages
   (bureaux.css, .bulle-chef). body.fenetre-alpha est pose par chat.js. Ses paroles ne s'ecrivent plus sur le mur
   (#live-words cache) : elles vont dans la fenetre ; fenetre fermee, le bouton luit. */

/* le bouton : une pilule doree, en bas a droite (a gauche du lecteur de fichiers) */
body.fenetre-alpha #chat-toggle {
  width: auto;
  height: auto;
  right: 72px;
  bottom: 18px;
  gap: 9px;
  padding: 7px 15px 7px 7px;
  border-radius: 999px;
  border: 1px solid rgba(225, 185, 110, 0.5);
  background: linear-gradient(180deg, #1b2550, #101734);
  color: #f2dcab;
  font: italic 600 14px Georgia, "Palatino Linotype", serif;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  z-index: 60;
}
body.fenetre-alpha #chat-toggle .fa-visage {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #9fd0ff, #2a3d8f);
  box-shadow: 0 0 10px rgba(90, 141, 255, 0.55);
}
@keyframes faNouveau {
  0%, 100% { box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(225, 185, 110, 0); }
  50% { box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 0 0 6px rgba(225, 185, 110, 0.28); }
}
body.fenetre-alpha #chat-toggle.chat-toggle--nouveau { animation: faNouveau 1.4s ease-in-out infinite; }
body.fenetre-alpha.chat-open #chat-toggle { display: none !important; }

/* la fenetre : en bas a droite, l'historique visible, la saisie en bas */
body.fenetre-alpha .chat-panel {
  left: auto;
  right: 18px;
  bottom: 18px;
  width: min(400px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 120px));
  background: #0c1330;
  backdrop-filter: none;
  border: 1px solid rgba(225, 185, 110, 0.45);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  z-index: 1200;
  transform: translateY(16px);
}
body.fenetre-alpha .chat-panel--open { transform: translateY(0); }
body.fenetre-alpha .chat-panel__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px 9px 14px;
  border-bottom: 1px solid rgba(200, 214, 245, 0.09);
  font: italic 700 14px Georgia, "Palatino Linotype", serif;
  color: #f2dcab;
}
body.fenetre-alpha .chat-panel__header span { flex: 1 1 auto; }
body.fenetre-alpha .chat-panel__header button {
  width: 30px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid rgba(200, 214, 245, 0.14);
  color: rgba(200, 214, 245, 0.75);
  font-size: 13px;
}
body.fenetre-alpha .chat-panel__messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 6px;
}
body.fenetre-alpha .chat-bubble { font-size: 13.5px; }
body.fenetre-alpha .chat-bubble--amber { background: #18224a; border: 1px solid #2a3870; }
body.fenetre-alpha .chat-bubble--user { background: #3a2e14; border: 1px solid #6a5426; color: #f6ead0; }
body.fenetre-alpha .chat-panel__status { order: 0; text-align: left; padding: 4px 14px 0; }
body.fenetre-alpha .chat-panel__input-bar { border-top: 1px solid rgba(200, 214, 245, 0.09); }

/* ses paroles ne s'ecrivent plus sur le mur : elles sont dans la fenetre */
body.fenetre-alpha #live-words { display: none !important; }

/* le laptop (barre de Windows) : tout remonte un peu, comme avant */
@media (min-width: 641px) {
  body.web.fenetre-alpha #chat-toggle { bottom: 70px; }
  body.web.fenetre-alpha .chat-panel { bottom: 68px; height: min(520px, calc(100vh - 160px)); }
}
/* le telephone : la fenetre prend la largeur, la boule reste visible au-dessus */
@media (max-width: 640px) {
  body.fenetre-alpha #chat-toggle { right: 72px; bottom: 20px; width: auto; height: auto; font-size: 14px; }
  body.fenetre-alpha .chat-panel { right: 10px; left: 10px; width: auto; bottom: 10px; height: min(62vh, 520px); }
}

/* 15/10 (Lionel) : SUR LE TELEPHONE -- la croix du haut part (elle ne marchait pas, il glisse pour fermer),
   et le chat est un PETIT logo, comme sur l'ordinateur mais sans le texte. Il l'ouvre seulement quand il veut ecrire. */
html.app-tel #app-close-btn { display: none !important; }
html.app-tel body.fenetre-alpha #chat-toggle { padding: 6px; gap: 0; border-radius: 50%; width: auto; height: auto; }
html.app-tel body.fenetre-alpha #chat-toggle .fa-nom { display: none; }
html.app-tel body.fenetre-alpha #chat-toggle .fa-visage { width: 30px; height: 30px; }
/* 15/10 (Lionel) : les ONGLETS restent sur le telephone, pour qu'il aille lui-meme sur une page ; Alpha, lui, n'y
   emmene plus (tout ce qu'il demande s'ouvre dans le board). */
