/* Emotes des chats textuels (client/js/emotes.js) : bouton du champ, fenêtre de choix, emotes dans les messages.
   Style « Fanzine » : chargé après hud-fanzine.css, dont il reprend les jetons (encres rose, bleu, jaune, décalage de calage, coins droits). */

.chat-form { position: relative; }
.emote-btn { flex: none; width: 42px; min-width: 42px; padding: 0; display: grid; place-items: center; border-radius: 3px; }
.emote-btn img { width: 26px; height: 26px; transition: transform 0.12s; }
.emote-btn:hover img, .emote-btn[aria-expanded='true'] img { transform: rotate(-10deg) scale(1.08); }
.emote-btn[aria-expanded='true'] { background: var(--yellow, #ffd84a); box-shadow: 2px 2px 0 var(--pink, #ff5fae); }
.emote-btn:disabled { opacity: 0.45; }

.emote-pop { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); z-index: 20; max-height: min(320px, 46vh); overflow-y: auto; overscroll-behavior: contain;
  padding: 10px; display: grid; gap: 8px; transform: rotate(-0.4deg);
  background: var(--paper, var(--panel)); color: var(--ink, var(--text)); border: 2px solid var(--ink, var(--outline)); box-shadow: 4px 4px 0 var(--pink, #ff5fae); }
.emote-pop[hidden] { display: none; }
.emote-tabs { display: flex; gap: 6px; }
.emote-tab { flex: 1 1 0; min-height: 32px; padding: 0 8px; cursor: pointer; border: 2px solid var(--ink, var(--outline)); border-radius: 3px; background: var(--paper, var(--panel)); color: var(--ink, var(--text));
  font: 700 11px/1 var(--mono, monospace); text-transform: uppercase; letter-spacing: 0.04em; box-shadow: 2px 2px 0 var(--blue, #5b8cff); }
.emote-tab[aria-selected='true'] { background: var(--yellow, #ffd84a); color: #14121b; box-shadow: 2px 2px 0 var(--pink, #ff5fae); }
.emote-tab:focus-visible, .emote-cell:focus-visible { outline: 3px solid var(--blue, #5b8cff); outline-offset: 1px; }
.emote-title, .emote-sub { font: 500 10.5px/1 var(--mono, monospace); text-transform: uppercase; letter-spacing: 0.12em; color: var(--pink, #ff5fae); }
.emote-title { font-weight: 700; color: var(--ink, var(--text)); }
.emote-note { margin: 0; padding: 6px 8px; font: 400 11.5px/1.35 var(--mono, monospace); border: 1.5px dashed var(--line, rgba(255, 255, 255, 0.16)); }
.emote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 4px; }
.emote-cell { position: relative; aspect-ratio: 1; min-height: 42px; display: grid; place-items: center; padding: 3px; cursor: pointer; border: 1.5px solid transparent; border-radius: 3px; background: none; }
.emote-cell img { width: 32px; height: 32px; object-fit: contain; }
.emote-cell:hover:not(:disabled) { background: var(--surface-hover, rgba(255, 255, 255, 0.07)); border-color: var(--ink, var(--outline)); box-shadow: 2px 2px 0 var(--yellow, #ffd84a); transform: translate(-1px, -1px); }
.emote-cell:active:not(:disabled) { transform: translate(1px, 1px); box-shadow: none; }
.emote-cell:disabled { cursor: not-allowed; opacity: 0.35; filter: grayscale(1); }
.emote-cell.sub::after { content: 'SUB'; position: absolute; right: 0; bottom: 0; padding: 1px 2px; font: 700 7.5px/1 var(--mono, monospace); background: var(--blue, #5b8cff); color: #fffaf0; }

/* dans les messages : taille d'une ligne ; un message fait seulement d'emotes les montre en grand */
.msg .text .emote { width: auto; height: 24px; vertical-align: -6px; margin: 0 1px; }
.msg .text.only-emotes .emote { height: 36px; vertical-align: -10px; }
.chat-float .msg .text .emote, .chat-float .msg .text.only-emotes .emote { height: 20px; vertical-align: -5px; }

@media (max-width: 600px) {
  .emote-btn { width: 40px; min-width: 40px; }
  .emote-pop { left: 4px; right: 4px; max-height: 40vh; }
  .emote-grid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
}
