/* ============================================
   Emote System Styles
   Button, picker, display, unlock notification
   ============================================ */

/* ── Emote Button ── */
.emote-btn {
    position: fixed;
    bottom: 160px;
    right: 12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--primary-orange);
    background: rgba(45, 27, 14, 0.85);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease, background 0.15s ease;
}

.emote-btn:hover,
.emote-btn:active {
    transform: scale(1.1);
    background: rgba(255, 107, 53, 0.3);
}

/* ── Emote Picker (desktop: dropdown above button) ── */
.emote-picker {
    position: fixed;
    bottom: 210px;
    right: 12px;
    width: 240px;
    max-height: 280px;
    overflow-y: auto;
    background: rgba(30, 20, 10, 0.95);
    border: 1px solid rgba(255, 107, 53, 0.4);
    border-radius: var(--radius-md);
    padding: 8px;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
}

.emote-picker.hidden {
    display: none;
}

.emote-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 2px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.12s ease;
    min-height: 54px;
    user-select: none;
}

.emote-cell:hover {
    background: rgba(255, 107, 53, 0.2);
}

.emote-cell:active {
    background: rgba(255, 107, 53, 0.35);
    transform: scale(0.95);
}

.emote-cell-emoji {
    font-size: 1.6rem;
    line-height: 1.2;
}

.emote-cell-label {
    font-family: var(--font-body);
    font-size: 0.55rem;
    color: var(--text-secondary);
    margin-top: 2px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ── Locked Emotes ── */
.emote-locked {
    opacity: 0.35;
    cursor: not-allowed;
    position: relative;
}

.emote-locked:hover {
    background: transparent;
}

.emote-locked:active {
    transform: none;
}

.emote-locked .emote-cell-emoji {
    filter: grayscale(100%);
}

.emote-lock-icon {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.6rem;
    opacity: 0.7;
}

/* ── Emote Float Container ───────────────────────────── */
.emote-float-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 40;
}

/* ── Floating Emote ──────────────────────────────────── */
.emote-float {
  position: absolute;
  font-size: 3rem;
  pointer-events: none;
  animation-duration: 3s;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
}

.emote-float.from-me {
  bottom: 10px;
  animation-name: emote-float-up;
}

.emote-float.from-them {
  top: 10px;
  animation-name: emote-float-down;
}

@keyframes emote-float-up {
  0%   { transform: translateY(0) translateX(var(--wobble, 0px)); opacity: 1; }
  20%  { transform: translateY(-50px) translateX(calc(var(--wobble, 0px) + 12px)); opacity: 1; }
  40%  { transform: translateY(-100px) translateX(var(--wobble, 0px)); opacity: 1; }
  60%  { transform: translateY(-150px) translateX(calc(var(--wobble, 0px) - 12px)); opacity: 1; }
  83%  { transform: translateY(-210px) translateX(var(--wobble, 0px)); opacity: 1; }
  100% { transform: translateY(-250px) translateX(var(--wobble, 0px)); opacity: 0; }
}

@keyframes emote-float-down {
  0%   { transform: translateY(0) translateX(var(--wobble, 0px)); opacity: 1; }
  20%  { transform: translateY(50px) translateX(calc(var(--wobble, 0px) + 12px)); opacity: 1; }
  40%  { transform: translateY(100px) translateX(var(--wobble, 0px)); opacity: 1; }
  60%  { transform: translateY(150px) translateX(calc(var(--wobble, 0px) - 12px)); opacity: 1; }
  83%  { transform: translateY(210px) translateX(var(--wobble, 0px)); opacity: 1; }
  100% { transform: translateY(250px) translateX(var(--wobble, 0px)); opacity: 0; }
}

@media (max-width: 480px) {
  .emote-float { font-size: 2.5rem; }
}

/* ── Emote Unlock Notification ── */
.emote-unlock-notification {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 20, 10, 0.95);
    border: 1px solid var(--primary-orange);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    z-index: 110;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
    white-space: nowrap;
    transition: bottom 0.4s ease-out;
}

.emote-unlock-notification.hidden {
    display: none;
}

.emote-unlock-notification.emote-unlock-visible {
    bottom: 24px;
}

.emote-unlock-emoji {
    font-size: 1.8rem;
}

.emote-unlock-text {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-primary);
}

.emote-unlock-text strong {
    color: var(--primary-orange);
    font-family: var(--font-display);
    font-size: 0.9rem;
}

/* ── Mobile: bottom sheet picker ── */
@media (max-width: 600px) {
    .emote-btn {
        bottom: 140px;
        right: 8px;
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .emote-picker {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 50vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        border-bottom: none;
        padding: 12px 8px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .emote-cell {
        min-height: 50px;
        padding: 4px 2px;
    }

    .emote-cell-emoji {
        font-size: 1.5rem;
    }

    .emote-display {
        font-size: 3.5rem;
    }

    .emote-unlock-notification {
        left: 12px;
        right: 12px;
        transform: none;
        width: auto;
    }
}
