/**
 * QUIZTREFF EMOTE TILES
 * =====================
 * Consistent emote rendering with Quiztreff brand frame
 */

/* ===========================================
   EMOTE TILE (the brand wrapper)
   =========================================== */

.qt-emote {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;

    /* Default size */
    width: 48px;
    height: 48px;

    /* Quiztreff frame */
    background: linear-gradient(135deg, rgba(10, 8, 6, 0.9), rgba(20, 15, 25, 0.85));
    border: 1px solid rgba(124, 58, 237, 0.35);
    border-radius: 10px;

    /* Subtle glow */
    box-shadow:
        0 0 8px rgba(124, 58, 237, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);

    /* Smooth transitions */
    transition: all 0.12s ease;
    cursor: default;
}

/* Hover effect */
.qt-emote:hover {
    transform: scale(1.03);
    border-color: rgba(124, 58, 237, 0.55);
    box-shadow:
        0 0 16px rgba(124, 58, 237, 0.3),
        0 0 32px rgba(255, 0, 128, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Active/selected state */
.qt-emote.selected,
.qt-emote.equipped {
    border-color: rgba(34, 197, 94, 0.6);
    box-shadow:
        0 0 12px rgba(34, 197, 94, 0.3),
        inset 0 0 8px rgba(34, 197, 94, 0.1);
}

.qt-emote.equipped::after {
    content: '✓';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 14px;
    height: 14px;
    background: #22c55e;
    border-radius: 50%;
    font-size: 9px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* ===========================================
   SIZE VARIANTS
   =========================================== */

.qt-emote-xs {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.qt-emote-sm {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.qt-emote-md {
    width: 48px;
    height: 48px;
}

.qt-emote-lg {
    width: 64px;
    height: 64px;
    border-radius: 12px;
}

.qt-emote-xl {
    width: 80px;
    height: 80px;
    border-radius: 14px;
}

.qt-emote-2xl {
    width: 96px;
    height: 96px;
    border-radius: 16px;
}

/* ===========================================
   INNER CONTENT (emoji or svg)
   =========================================== */

.qt-emote-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 4px;
}

/* Emoji content */
.qt-emote-inner .emoji,
.qt-emote-inner img.twemoji {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

/* SVG content */
.qt-emote-inner svg,
.qt-emote-inner img.qt-svg {
    width: 85%;
    height: 85%;
    object-fit: contain;
}

/* Native emoji fallback */
.qt-emote-inner .native-emoji {
    font-size: 1.5em;
    line-height: 1;
}

.qt-emote-xs .qt-emote-inner .native-emoji { font-size: 1rem; }
.qt-emote-sm .qt-emote-inner .native-emoji { font-size: 1.25rem; }
.qt-emote-md .qt-emote-inner .native-emoji { font-size: 1.5rem; }
.qt-emote-lg .qt-emote-inner .native-emoji { font-size: 2rem; }
.qt-emote-xl .qt-emote-inner .native-emoji { font-size: 2.5rem; }
.qt-emote-2xl .qt-emote-inner .native-emoji { font-size: 3rem; }

/* ===========================================
   Q BRAND BADGE (optional subtle branding)
   =========================================== */

.qt-emote.with-badge::before {
    content: 'Q';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 12px;
    height: 12px;
    background: rgba(124, 58, 237, 0.8);
    border-radius: 50%;
    font-size: 7px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.2;
    transition: opacity 0.15s;
}

.qt-emote.with-badge:hover::before {
    opacity: 0.5;
}

/* ===========================================
   RARITY BORDERS
   =========================================== */

.qt-emote.rarity-common {
    border-color: rgba(156, 163, 175, 0.4);
}

.qt-emote.rarity-uncommon {
    border-color: rgba(34, 197, 94, 0.5);
}

.qt-emote.rarity-rare {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.qt-emote.rarity-epic {
    border-color: rgba(168, 85, 247, 0.55);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
}

.qt-emote.rarity-legendary {
    border-color: rgba(251, 191, 36, 0.6);
    box-shadow:
        0 0 15px rgba(251, 191, 36, 0.3),
        0 0 30px rgba(251, 191, 36, 0.1);
}

.qt-emote.rarity-mythic {
    border-color: rgba(236, 72, 153, 0.6);
    background: linear-gradient(135deg, rgba(20, 10, 25, 0.95), rgba(30, 15, 35, 0.9));
    box-shadow:
        0 0 20px rgba(236, 72, 153, 0.35),
        0 0 40px rgba(124, 58, 237, 0.15);
    animation: mythic-pulse 3s ease-in-out infinite;
}

@keyframes mythic-pulse {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(236, 72, 153, 0.35),
            0 0 40px rgba(124, 58, 237, 0.15);
    }
    50% {
        box-shadow:
            0 0 25px rgba(236, 72, 153, 0.45),
            0 0 50px rgba(124, 58, 237, 0.25);
    }
}

/* ===========================================
   EMOTE GRID (for shop/preview)
   =========================================== */

.qt-emote-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 8px;
    padding: 8px;
}

.qt-emote-grid.compact {
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 6px;
}

.qt-emote-grid.large {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 12px;
}

/* ===========================================
   EMOTE WITH LABEL
   =========================================== */

.qt-emote-labeled {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.qt-emote-label {
    font-size: 0.65rem;
    color: rgba(255, 235, 200, 0.6);
    text-align: center;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===========================================
   LOADING STATE
   =========================================== */

.qt-emote.loading .qt-emote-inner {
    background: linear-gradient(90deg,
        rgba(255,255,255,0.03) 0%,
        rgba(255,255,255,0.08) 50%,
        rgba(255,255,255,0.03) 100%
    );
    background-size: 200% 100%;
    animation: emote-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes emote-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===========================================
   CLICKABLE EMOTES (in chat, reactions)
   =========================================== */

.qt-emote.clickable {
    cursor: pointer;
}

.qt-emote.clickable:active {
    transform: scale(0.95);
}

/* ===========================================
   INLINE EMOTES (in text)
   =========================================== */

.qt-emote-inline {
    display: inline-flex;
    width: 1.4em;
    height: 1.4em;
    vertical-align: -0.25em;
    border-radius: 4px;
    border-width: 0;
    background: transparent;
    box-shadow: none;
}

.qt-emote-inline:hover {
    transform: none;
    box-shadow: none;
}

.qt-emote-inline .qt-emote-inner {
    padding: 0;
}

.qt-emote-inline .qt-emote-inner svg,
.qt-emote-inline .qt-emote-inner img {
    width: 100%;
    height: 100%;
}
