/* ─────────────── CE QUI RESTE DE L'ANCIEN LOBBY AU DOIGT, et que le lobby de l'entrée (css/hub.css) reprend : la pastille
   de profil (avatar, niveau), le CHAT du groupe et du salon (une fenêtre sombre qui sort de la droite, avec les émotes),
   les bulles et les émotes au-dessus des balles, la façon de bouger de chaque balle (js/br/app.js : hmAnim), et la petite
   fenêtre du pseudo. Le reste de l'ancien lobby (la scène à projecteurs, les socles, le choix du mode) a été retiré avec
   lui. ─── */

.hm-ava { position: relative; flex: none; width: 40px; height: 40px; box-sizing: border-box; border: 3px solid var(--ink); border-radius: 50%; background: #fff; }
.hm-ava img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.hm-lvl { position: absolute; right: -9px; bottom: -7px; min-width: 22px; height: 22px; box-sizing: border-box; padding: 0 4px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 11px; background: var(--gold); color: var(--ink); font: italic 800 13px/1 var(--fc); }
.hm-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin-left: 5px; }
.hm-txt b { font: italic 800 22px/1 var(--fc); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-txt small { font: 700 11px/1.15 var(--fc); letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hsd-n { position: absolute; z-index: 2; top: -7px; right: -7px; min-width: 22px; height: 22px; box-sizing: border-box; padding: 0 5px; border: 2.5px solid var(--ink); border-radius: 11px; background: #FF3B30; color: #fff; font: 800 13px/17px var(--fc); font-style: normal; text-align: center; }
/* ─── LE CHAT (Js' : « mets-le à droite comme brawl stars, avec une fenêtre qui s'ouvre de la droite, et tu peux emote
   aussi ») : une fenêtre sombre qui glisse depuis le bord droit, sur toute la hauteur — les messages (les tiens à droite,
   en or), les émotes de ta roue, la ligne pour écrire ; seul, de quoi inviter tes potes ─── */
.home-chat { position: absolute; z-index: 9; top: 0; right: 0; bottom: 0; width: min(390px, 48vw); box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) 12px; border-left: 4px solid var(--ink); border-radius: 18px 0 0 18px; background: #1E1A2B; box-shadow: -5px 0 0 rgba(21, 21, 21, 0.35); color: #fff; transform: translateX(105%); transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1); }
.home-chat.open { transform: none; }
.hc-top { flex: none; display: flex; align-items: center; gap: 10px; min-width: 0; }
.hc-top b { font: italic 800 26px/1 var(--fc); text-transform: uppercase; text-shadow: var(--out); padding: 0 2px 3px 0; }
.hc-top small { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 12px/1 var(--fc); letter-spacing: 1px; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); }
.home-chat .hc-x { width: 40px; height: 40px; font-size: 20px; border-width: 3px; box-shadow: 2px 2px 0 var(--ink); }
.hc-log { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 2px 4px 2px 0; list-style: none; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.hc-log li { flex: none; align-self: flex-start; max-width: 86%; box-sizing: border-box; padding: 5px 10px 6px; border: 2.5px solid var(--ink); border-radius: 12px 12px 12px 4px; background: var(--card); color: var(--ink); font: 600 14px/1.3 var(--fb); overflow-wrap: anywhere; }
.hc-log li b { display: block; margin-bottom: 1px; font: italic 800 13px/1.1 var(--fc); text-transform: uppercase; color: #6B2FC0; }
.hc-log li.mine { align-self: flex-end; border-radius: 12px 12px 4px 12px; background: var(--gold); }
.hc-log li.mine b { display: none; }
.hc-log li.sys { align-self: center; max-width: 100%; padding: 0 4px; border: 0; background: none; color: rgba(255, 255, 255, 0.72); font: italic 600 12px/1.3 var(--fb); }
.hc-log li.emo { padding: 3px 8px 4px; }
.hc-log li.emo canvas { display: block; width: 58px; height: 58px; margin: 0 auto; }
.hc-empty { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 0 10px; text-align: center; }
.hc-empty p { margin: 0; font: 600 15px/1.4 var(--fb); color: rgba(255, 255, 255, 0.9); }
.hc-empty .btn { font-size: 22px; padding: 6px 26px 8px; }
.hc-emos { flex: none; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.hc-emo { aspect-ratio: 1; min-width: 0; padding: 0; border: 2.5px solid var(--ink); border-radius: 10px; background: rgba(255, 255, 255, 0.14); cursor: pointer; transition: transform 0.08s ease; }
.hc-emo:active { transform: scale(0.9); }
.hc-emo canvas { display: block; width: 100%; height: 100%; }
.hc-in { flex: none; display: flex; gap: 6px; margin: 0; }
.hc-in input { flex: 1; min-width: 0; height: 44px; box-sizing: border-box; padding: 0 12px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); font: 600 16px var(--fb); outline: none; }
.hc-in input:focus { box-shadow: 0 0 0 3px var(--gold); }
.hc-send { flex: none; width: 44px; height: 44px; box-sizing: border-box; display: grid; place-items: center; padding: 0; border: 3px solid var(--ink); border-radius: 12px; background: var(--gold); color: #fff; box-shadow: 2px 2px 0 var(--ink); cursor: pointer; }
.hc-send:active { transform: translate(2px, 2px); box-shadow: none; }
.hc-send svg { width: 24px; height: 24px; }
.hc-wait { flex: none; font: 700 12px/1 var(--fc); letter-spacing: 1px; text-transform: uppercase; color: var(--gold); }
/* (une émote, au lobby : à côté de la balle de celui qui l'envoie, quelques secondes) */
.hs-emo { position: absolute; z-index: 6; left: calc(50% + var(--s) * 0.36); top: calc(clamp(18px, 6vh, 26px) + var(--s) * 0.16); width: calc(var(--s) * 0.5); aspect-ratio: 1; translate: -50% -50%; pointer-events: none; }
.hs-crown { width: 1.25em; height: 1.25em; flex: none; filter: drop-shadow(1px 1.5px 0 var(--ink)); }
/* la balle : dessinée par le jeu, à la bonne taille ; son dessin déborde (auras, armes, orbes) sans gêner les appuis */
.hs-ball { position: relative; z-index: 2; display: block; width: var(--s); height: var(--s); padding: 0; border: 0; background: none; cursor: pointer; transform-origin: 50% 90%; animation-delay: var(--dl, 0s); }
.hs-ball canvas { position: absolute; left: 50%; top: 50%; width: calc(var(--s) * var(--k, 1.7)); height: calc(var(--s) * var(--k, 1.7)); transform: translate(-50%, -50%); pointer-events: none; }

/* ─── chaque balle a SA façon de bouger (js/br/app.js : hmAnim, d'après son perso) — saute, flotte, tape du pied, se
   dandine, tourne, respire, tremble, se balance, rebondit en gelée, fonce, se retourne comme une pièce, tourne en rond ─── */
.a-hop .hs-ball { animation: aHop 1.4s ease-in-out infinite var(--dl, 0s); }
@keyframes aHop { 0%, 56%, 100% { transform: translateY(0) scale(1, 1); } 8% { transform: translateY(0) scale(1.09, 0.91); } 23% { transform: translateY(-11%) scale(0.95, 1.06); } 38% { transform: translateY(0) scale(1.08, 0.92); } 47% { transform: translateY(0) scale(0.98, 1.02); } }
.a-bounce .hs-ball { animation: aBounce 0.95s infinite var(--dl, 0s); }
@keyframes aBounce { 0%, 100% { transform: translateY(0) scale(1.1, 0.9); animation-timing-function: cubic-bezier(0.3, 0.6, 0.6, 1); } 50% { transform: translateY(-14%) scale(0.96, 1.05); animation-timing-function: cubic-bezier(0.4, 0, 0.7, 0.4); } }
.a-float .hs-ball { animation: aFloat 3.6s ease-in-out infinite var(--dl, 0s); }
@keyframes aFloat { 0%, 100% { transform: translateY(-9%) rotate(-4deg); } 50% { transform: translateY(-2%) rotate(4deg); } }
.a-stomp .hs-ball { animation: aStomp 2.6s infinite var(--dl, 0s); }
@keyframes aStomp { 0%, 66%, 100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-9%) scale(0.97, 1.04); animation-timing-function: cubic-bezier(0.6, 0, 1, 0.6); } 50% { transform: translateY(1%) scale(1.16, 0.85); } 55% { transform: translateY(0) scale(0.95, 1.05); } 60% { transform: translateY(0) scale(1.03, 0.97); } }
.a-wobble .hs-ball { animation: aWobble 1.9s ease-in-out infinite var(--dl, 0s); }
@keyframes aWobble { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }
.a-spin .hs-ball { transform-origin: 50% 50%; animation: aSpin 3.4s infinite var(--dl, 0s); }
@keyframes aSpin { 0%, 58% { transform: rotate(0deg); } 78% { transform: rotate(385deg); animation-timing-function: ease-out; } 87% { transform: rotate(352deg); } 94%, 100% { transform: rotate(360deg); } }
.a-breathe .hs-ball { transform-origin: 50% 70%; animation: aBreathe 2.4s ease-in-out infinite var(--dl, 0s); }
@keyframes aBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.a-shake .hs-ball { animation: aShake 3.2s infinite var(--dl, 0s); }
@keyframes aShake { 0%, 60%, 100% { transform: translate(0, 0) rotate(0deg); } 62% { transform: translate(-3%, 0) rotate(-4deg); } 65% { transform: translate(3%, -1%) rotate(4deg); } 68% { transform: translate(-3%, 1%) rotate(-3deg); } 71% { transform: translate(3%, 0) rotate(3deg); } 74% { transform: translate(-2%, 0) rotate(-2deg); } 77% { transform: translate(0, 0) rotate(0deg); } }
.a-sway .hs-ball { animation: aSway 3s ease-in-out infinite var(--dl, 0s); }
@keyframes aSway { 0%, 100% { transform: translateX(-7%) rotate(-6deg); } 50% { transform: translateX(7%) rotate(6deg); } }
.a-jelly .hs-ball { animation: aJelly 1.9s ease-in-out infinite var(--dl, 0s); }
@keyframes aJelly { 0%, 82%, 100% { transform: scale(1, 1); } 12% { transform: scale(1.12, 0.88); } 26% { transform: scale(0.9, 1.1); } 40% { transform: scale(1.06, 0.94); } 54% { transform: scale(0.97, 1.03); } 68% { transform: scale(1.01, 0.99); } }
.a-dash .hs-ball { animation: aDash 2.6s infinite var(--dl, 0s); }
@keyframes aDash { 0%, 55%, 100% { transform: translateX(0) skewX(0deg); } 61% { transform: translateX(-13%) skewX(14deg); } 67% { transform: translateX(15%) skewX(-14deg); } 73% { transform: translateX(-4%) skewX(4deg); } 80% { transform: translateX(0) skewX(0deg); } }
.a-flip .hs-ball { transform-origin: 50% 50%; animation: aFlip 4.2s infinite var(--dl, 0s); }
@keyframes aFlip { 0%, 64% { transform: perspective(600px) rotateY(0deg); } 84%, 100% { transform: perspective(600px) rotateY(360deg); } }
.a-orbit .hs-ball { animation: aOrbit 3.2s linear infinite var(--dl, 0s); }
@keyframes aOrbit { 0% { transform: translate(6%, 0) rotate(0deg); } 25% { transform: translate(0, -6%) rotate(-5deg); } 50% { transform: translate(-6%, 0) rotate(0deg); } 75% { transform: translate(0, 4%) rotate(5deg); } 100% { transform: translate(6%, 0) rotate(0deg); } }
/* (un appui sur une balle : elle saute et fait un tour, puis… on change de balle, ou on voit le profil du pote) */
.hs-ball.react { animation: aReact 0.45s cubic-bezier(0.2, 1.3, 0.4, 1) !important; }
@keyframes aReact { 0% { transform: scale(1); } 35% { transform: translateY(-12%) scale(1.1) rotate(-18deg); } 70% { transform: translateY(0) scale(0.9, 1.1) rotate(10deg); } 100% { transform: scale(1) rotate(0deg); } }

/* les messages du chat : une bulle en haut à droite de la balle de celui qui écrit, quelques secondes (sans cacher son
   nom ni la couronne) ; pour la place de droite, en haut à gauche (elle ne sort pas de l'écran) */
.hs-say { position: absolute; z-index: 5; top: calc(clamp(18px, 6vh, 26px) + var(--s) * 0.24); left: calc(50% + var(--s) * 0.24); width: max-content; max-width: min(28vw, 250px); box-sizing: border-box; padding: 6px 10px 7px; border: 3px solid var(--ink); border-radius: 12px 12px 12px 4px; background: var(--card); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); font: 600 clamp(12px, 3.8vh, 16px)/1.2 var(--fb); text-align: left; overflow-wrap: anywhere; transform: translateY(-100%); transform-origin: 0 100%; animation: hssay 0.25s cubic-bezier(0.2, 1.6, 0.4, 1); pointer-events: none; }
.hs-say::after { content: ''; position: absolute; left: 8px; top: 100%; width: 10px; height: 10px; margin-top: -4px; background: var(--card); border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: rotate(45deg); }
@keyframes hssay { from { transform: translateY(-100%) scale(0.6); opacity: 0; } }

/* ─── la petite fenêtre du pseudo, et « Quitter le groupe » dans celle du groupe ─── */
.name-box { width: min(440px, 100%); }
.name-help { margin: 0 0 12px; font-size: 15px; line-height: 1.35; }
.name-row { display: flex; gap: 8px; }
.name-row input { flex: 1; min-width: 0; height: 52px; box-sizing: border-box; padding: 0 14px; border: 3px solid var(--ink); border-radius: 10px; background: #fff; font: 800 24px var(--fc); letter-spacing: 1px; color: var(--ink); outline: none; }
.name-row input:focus { box-shadow: 0 0 0 3px var(--gold); }
.name-row input.need { border-color: #D1495B; box-shadow: 0 0 0 3px rgba(209, 73, 91, 0.35); animation: needshake 0.35s ease; }
.name-row .btn { flex: none; min-width: 84px; font-size: 24px; padding: 6px 18px 8px; }
.party-quit { display: block; margin: 12px 0 0 auto; font-size: 17px; padding: 6px 14px 8px; background: #FFE3DF; }
@media (max-height: 520px) {
  .name-help { margin-bottom: 8px; font-size: 13px; }
  .name-row input { height: 44px; font-size: 20px; }
  .name-row .btn { font-size: 20px; padding: 4px 14px 6px; }
  .party-quit { margin-top: 8px; font-size: 15px; padding: 4px 12px 6px; }
}
@media (max-height: 520px) {
  .home-chat { gap: 6px; }
  .hc-top b { font-size: 22px; }
  .home-chat .hc-x { width: 36px; height: 36px; font-size: 18px; }
  .hc-in input, .hc-send { height: 40px; }
  .hc-send { width: 40px; }
}
@media (prefers-reduced-motion: reduce) { .hs-ball { animation: none !important; } }
