/* Réactions rapides en partie (Services/Reactions.cs) : bouton 😜 à côté du tchat, palette,
   smiley animé au milieu de l'écran et petit smiley à côté du nom de l'auteur. */

.chat-buttons {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.reaction-toggle {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(3px);
    transition: transform 0.15s ease, background 0.15s ease;
}

.reaction-toggle:hover,
.reaction-toggle.open {
    background: rgba(224, 180, 0, 0.35);
    transform: rotate(-12deg) scale(1.1);
}

.reaction-palette {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.3rem;
    width: min(320px, 86vw);
    padding: 0.5rem;
    border-radius: 14px;
    background: rgba(6, 28, 18, 0.96);
    border: 1px solid rgba(224, 180, 0, 0.55);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
    animation: palette-in 0.16s ease-out;
}

.reaction-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.12s ease;
}

.reaction-chip:hover {
    transform: translateY(-1px) scale(1.03);
    background: rgba(255, 255, 255, 0.14);
}

.reaction-chip-emoji {
    font-size: 1.25rem;
}

.reaction-chip.tone-agressif { border-color: rgba(255, 90, 70, 0.45); }
.reaction-chip.tone-wtf { border-color: rgba(190, 120, 255, 0.45); }
.reaction-chip.tone-gentil { border-color: rgba(90, 220, 140, 0.45); }
.reaction-chip.tone-drôle { border-color: rgba(255, 210, 80, 0.45); }

/* ---------- Réactions reçues : au milieu, en haut de la table ---------- */
.reaction-stage {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 86;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}

.reaction-pop {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: reaction-life 3.2s ease forwards;
}

.reaction-emoji {
    font-size: clamp(2.6rem, 9vw, 3.8rem);
    line-height: 1;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5));
}

.reaction-bubble {
    position: relative;
    padding: 0.5rem 0.9rem;
    border-radius: 16px;
    background: rgba(6, 28, 18, 0.95);
    color: #fff;
    font-weight: 900;
    font-size: clamp(0.95rem, 3.4vw, 1.2rem);
    white-space: nowrap;
    border: 3px solid var(--seat-color, var(--gold));
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.reaction-bubble strong {
    color: var(--seat-color, var(--gold));
    margin-right: 0.3rem;
}

.reaction-bubble::before {
    content: "";
    position: absolute;
    left: -11px;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-right-color: var(--seat-color, var(--gold));
}

.reaction-pop.tone-agressif .reaction-bubble { background: linear-gradient(135deg, rgba(90, 14, 10, 0.96), rgba(6, 28, 18, 0.96)); }
.reaction-pop.tone-wtf .reaction-bubble { background: linear-gradient(135deg, rgba(58, 20, 92, 0.96), rgba(6, 28, 18, 0.96)); }
.reaction-pop.tone-gentil .reaction-bubble { background: linear-gradient(135deg, rgba(12, 80, 44, 0.96), rgba(6, 28, 18, 0.96)); }

/* Petit smiley à côté du nom de l'adversaire qui vient de réagir. */
.seat-reaction {
    display: inline-block;
    font-size: 1.05rem;
    margin-left: 0.2rem;
}

/* ---------- Animations du smiley ---------- */
.react-anim-pop { animation: react-pop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.react-anim-shake { animation: react-shake 0.7s ease-in-out 2; }
.react-anim-spin { animation: react-spin 0.8s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
.react-anim-bounce { animation: react-bounce 0.9s ease 2; }
.react-anim-float { animation: react-float 1.6s ease-in-out 2; }
.react-anim-pulse { animation: react-pulse 0.7s ease-in-out 3; }

@keyframes reaction-life {
    0% { opacity: 0; transform: translateY(18px) scale(0.7); }
    10% { opacity: 1; transform: translateY(0) scale(1.05); }
    16% { transform: scale(1); }
    82% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-26px); }
}

@keyframes react-pop {
    0% { transform: scale(0.2); }
    100% { transform: scale(1); }
}

@keyframes react-shake {
    0%, 100% { transform: translateX(0) rotate(0); }
    20% { transform: translateX(-6px) rotate(-12deg); }
    40% { transform: translateX(6px) rotate(10deg); }
    60% { transform: translateX(-4px) rotate(-8deg); }
    80% { transform: translateX(4px) rotate(6deg); }
}

@keyframes react-spin {
    from { transform: rotate(-360deg) scale(0.3); }
    to { transform: rotate(0) scale(1); }
}

@keyframes react-bounce {
    0%, 100% { transform: translateY(0); }
    30% { transform: translateY(-16px) scale(1.08, 0.94); }
    50% { transform: translateY(0) scale(0.94, 1.08); }
    70% { transform: translateY(-6px); }
}

@keyframes react-float {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-10px) rotate(4deg); }
}

@keyframes react-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.22); }
}

@keyframes palette-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.96); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 700px) {
    .reaction-stage { top: 26%; width: 92vw; }
    .reaction-bubble { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
    .reaction-pop,
    .reaction-palette,
    [class*="react-anim-"] {
        animation: none;
    }
}
