﻿/**
 * ════════════════════════════════════════════════════════════════
 * 🎮 STREAM CHAT EFFECTS & PROFILE MODAL CSS v2.1
 * ════════════════════════════════════════════════════════════════
 * Chat effects and user profile modal styles for streaming pages
 * IDENTICAL to LiveChat styles for consistency
 */

/* ========== 📦 STREAM CHAT CONTAINER STYLES ========== */
/* Styles for the streamer's chat container */

#emulatorChatContainer {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    overflow: hidden !important;
}

#streamChatMessages {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-height: 0 !important;
    padding: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}

#streamChatMessages::-webkit-scrollbar {
    width: 6px;
}

#streamChatMessages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

#streamChatMessages::-webkit-scrollbar-thumb {
    background: rgba(255, 45, 85, 0.5);
    border-radius: 3px;
}

/* ========== 📦 BASE CHAT MESSAGE BOX STYLES ========== */
/* These are the same as in index.html for LiveChat */

.chat-message-box {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    margin: 4px 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 0, 64, 0.03));
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    animation: messageSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: left center;
}

@keyframes messageSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.chat-message-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 0, 64, 0.08), rgba(99, 102, 241, 0.05));
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.chat-message-box:hover::before {
    opacity: 1;
}

/* Special Effects canvas overlay (Store: "Special Effects") */
.chat-message-box .chat-special-effect-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
}

.chat-message-box .chat-msg-avatar,
.chat-message-box .chat-msg-content {
    position: relative;
    z-index: 2;
}

/* Store profile effects applied to stream/viewer messages */
.stream-message .special-effect-particles,
.chat-message-box .special-effect-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    border-radius: inherit;
    opacity: 0.9;
}

.stream-message .special-effect-particles::before,
.stream-message .special-effect-particles::after,
.chat-message-box .special-effect-particles::before,
.chat-message-box .special-effect-particles::after {
    content: '';
    position: absolute;
    inset: -25%;
    background-repeat: repeat;
    will-change: transform, opacity;
}

.effect-sparkles::before {
    background-image: radial-gradient(circle, rgba(255,255,210,0.85) 0 2px, transparent 3px);
    background-size: 28px 28px;
    animation: storeFxDrift 3s linear infinite;
}
.effect-confetti::before {
    background-image: linear-gradient(45deg, #ff3366 0 45%, transparent 46%), linear-gradient(-45deg, #33e1ff 0 45%, transparent 46%), linear-gradient(90deg, #ffd34d 0 45%, transparent 46%);
    background-size: 22px 22px, 31px 31px, 27px 27px;
    animation: storeFxRain 2.8s linear infinite;
}
.effect-sakura::before {
    background-image: radial-gradient(ellipse at center, rgba(255,182,193,0.8) 0 3px, transparent 4px);
    background-size: 34px 26px;
    transform: rotate(14deg);
    animation: storeFxRain 5s linear infinite;
}
.effect-snow::before {
    background-image: radial-gradient(circle, rgba(255,255,255,0.85) 0 2px, transparent 3px);
    background-size: 24px 24px;
    animation: storeFxRain 4.2s linear infinite;
}
.effect-fireflies::before {
    background-image: radial-gradient(circle, rgba(255,255,120,0.95) 0 3px, rgba(255,220,70,0.25) 4px, transparent 8px);
    background-size: 46px 36px;
    animation: storeFxFireflies 3.4s ease-in-out infinite;
}
.effect-bubbles::before {
    background-image: radial-gradient(circle, transparent 0 4px, rgba(120,220,255,0.55) 5px, transparent 7px);
    background-size: 34px 34px;
    animation: storeFxRise 4.2s linear infinite;
}
.effect-leaves::before {
    background-image: radial-gradient(circle, #ffd34d 0 5px, #8a5700 6px, transparent 7px);
    background-size: 42px 34px;
    animation: storeFxCoinRain 2.6s linear infinite;
}
.effect-hearts::before {
    background-image: radial-gradient(circle, rgba(255,232,70,0.95) 0 2px, transparent 4px), radial-gradient(circle, rgba(255,255,255,0.8) 0 1px, transparent 3px);
    background-size: 26px 26px, 42px 42px;
    animation: storeFxOrbit 3.2s linear infinite;
}
.effect-embers::before {
    background-image: radial-gradient(circle, rgba(255,245,160,0.95) 0 2px, rgba(255,80,0,0.55) 3px, transparent 9px);
    background-size: 50px 24px;
    animation: storeFxFireballs 2s linear infinite;
}
.effect-lightning::before {
    background: linear-gradient(115deg, transparent 0 42%, rgba(255,255,120,0.9) 43% 45%, transparent 46% 52%, rgba(255,255,255,0.72) 53% 54%, transparent 55% 100%);
    opacity: 0;
    animation: storeFxLightning 1.45s steps(1,end) infinite;
}
.effect-glitch::before {
    background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.06) 0 1px, transparent 1px 5px), linear-gradient(90deg, rgba(0,255,255,0.25), transparent 40%, rgba(255,0,100,0.28));
    animation: storeFxGlitch 0.85s steps(2,end) infinite;
}
.effect-glitch::after {
    background-image: linear-gradient(90deg, transparent, rgba(255,255,255,0.24), transparent);
    height: 18px;
    top: 30%;
    inset-inline: -10%;
    opacity: 0.5;
    animation: storeFxGlitchSlice 1.1s steps(3,end) infinite;
}

@keyframes storeFxDrift {
    from { transform: translate3d(0,0,0); }
    to { transform: translate3d(28px,28px,0); }
}
@keyframes storeFxRain {
    from { transform: translate3d(0,-20%,0); }
    to { transform: translate3d(20%,35%,0); }
}
@keyframes storeFxRise {
    from { transform: translate3d(0,25%,0); }
    to { transform: translate3d(15%,-20%,0); }
}
@keyframes storeFxFireflies {
    0%, 100% { transform: translate3d(0,0,0); opacity: 0.55; }
    50% { transform: translate3d(16px,-8px,0); opacity: 1; }
}
@keyframes storeFxCoinRain {
    from { transform: translate3d(-10%,-25%,0) rotate(0deg); }
    to { transform: translate3d(12%,35%,0) rotate(12deg); }
}
@keyframes storeFxOrbit {
    from { transform: rotate(0deg) scale(1); opacity: 0.6; }
    50% { transform: rotate(180deg) scale(1.08); opacity: 1; }
    to { transform: rotate(360deg) scale(1); opacity: 0.6; }
}
@keyframes storeFxFireballs {
    from { transform: translate3d(-25%,15%,0); }
    to { transform: translate3d(32%,-18%,0); }
}
@keyframes storeFxLightning {
    0%, 72%, 100% { opacity: 0; transform: translateX(-12%); }
    73%, 80% { opacity: 1; transform: translateX(8%); }
    81%, 84% { opacity: 0.35; transform: translateX(-3%); }
}
@keyframes storeFxGlitch {
    0%, 100% { transform: translate3d(0,0,0); opacity: 0.36; }
    35% { transform: translate3d(-8px,2px,0); opacity: 0.72; }
    70% { transform: translate3d(7px,-2px,0); opacity: 0.58; }
}
@keyframes storeFxGlitchSlice {
    0%, 100% { transform: translateY(-16px); opacity: 0; }
    35% { transform: translateY(22px); opacity: 0.7; }
    70% { transform: translateY(-4px); opacity: 0.35; }
}

/* Ensure message box uses theme gradient when effect missing */
.chat-message-box:not([class*="chat-effect-"]) {
    background: linear-gradient(135deg, rgba(25, 25, 40, 0.9), rgba(15, 10, 25, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-message-box:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 0, 64, 0.05));
    border-color: rgba(255, 0, 64, 0.25);
    transform: translateX(4px) scale(1.01);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 0, 64, 0.1);
}

.chat-message-box.own-message {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(99, 102, 241, 0.08));
    border-color: rgba(102, 126, 234, 0.35);
    animation: messageSlideInOwn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: right center;
}

@keyframes messageSlideInOwn {
    0% {
        opacity: 0;
        transform: translateX(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.chat-message-box.own-message:hover {
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.chat-message-box.admin-message {
    border-left: 4px solid #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(255, 170, 0, 0.05));
    animation: adminMessageGlow 3s ease-in-out infinite;
}

@keyframes adminMessageGlow {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
    }
    50% { 
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.25);
    }
}

.chat-message-box.streamer-message {
    border-left: 4px solid #ff4081;
    background: linear-gradient(135deg, rgba(255, 64, 129, 0.12), rgba(255, 64, 129, 0.05));
}

.chat-msg-avatar {
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.chat-message-box:hover .chat-msg-avatar {
    transform: scale(1.1);
}

.chat-msg-content {
    flex: 1;
    min-width: 0;
}

.chat-msg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.chat-msg-name {
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.chat-msg-name::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #ff4081, #ff6b6b);
    transition: width 0.3s ease;
}

.chat-msg-name:hover {
    color: #ff6b6b;
}

.chat-msg-name:hover::after {
    width: 100%;
}

.chat-msg-name.admin {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.chat-msg-name.streamer {
    color: #ff4081;
    text-shadow: 0 0 10px rgba(255, 64, 129, 0.3);
}

.chat-admin-tag {
    background: linear-gradient(135deg, #ffd700, #ffa500);
    color: #000;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    animation: tagShimmer 3s ease-in-out infinite;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

@keyframes tagShimmer {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.chat-streamer-tag {
    background: linear-gradient(135deg, #ff4081, #f50057);
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(255, 64, 129, 0.3);
}

.chat-msg-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    margin-left: auto;
    flex-shrink: 0;
    transition: color 0.3s ease;
}

.chat-message-box:hover .chat-msg-time {
    color: rgba(255, 255, 255, 0.6);
}

.chat-msg-text {
    color: rgba(255, 255, 255, 0.92);
    word-break: break-word;
    line-height: 1.5;
    font-size: 14px;
    margin-top: 4px;
    display: block !important;
    visibility: visible !important;
    animation: textFadeIn 0.3s ease;
}

@keyframes textFadeIn {
    0% { opacity: 0; transform: translateY(5px); }
    100% { opacity: 1; transform: translateY(0); }
}

.chat-msg-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.chat-msg-header {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.chat-msg-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
}

.chat-msg-time {
    margin-left: auto;
    flex-shrink: 0;
}

.chat-admin-tag {
    flex-shrink: 0;
}

.chat-msg-avatar {
    flex-shrink: 0;
    cursor: pointer;
}

/* ========== 💠 CHAT EFFECT STYLES ========== */

/* 💫 Neon Glow Effect */
.chat-message-box.chat-effect-neon {
    border: 2px solid #00ffff !important;
    box-shadow: 
        0 0 15px rgba(0, 255, 255, 0.5), 
        0 0 30px rgba(0, 255, 255, 0.25),
        inset 0 0 25px rgba(0, 255, 255, 0.08) !important;
    animation: neonPulse 2s ease-in-out infinite;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.12), rgba(0, 200, 255, 0.08), rgba(0,50,80,0.3)) !important;
    position: relative;
    overflow: hidden;
}

.chat-message-box.chat-effect-neon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.2), transparent);
    animation: neonSweep 3s linear infinite;
    pointer-events: none;
    z-index: 0;
}

.chat-message-box.chat-effect-neon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ffff, transparent);
    animation: neonLineMove 2s linear infinite;
}

@keyframes neonPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(0, 255, 255, 0.5), 0 0 30px rgba(0, 255, 255, 0.25), inset 0 0 25px rgba(0, 255, 255, 0.08); }
    50% { box-shadow: 0 0 30px rgba(0, 255, 255, 0.8), 0 0 60px rgba(0, 255, 255, 0.4), inset 0 0 35px rgba(0, 255, 255, 0.15); }
}

@keyframes neonSweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes neonLineMove {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 🔥 Fire Effect */
.chat-message-box.chat-effect-fire {
    border: 2px solid #ff4500 !important;
    background: linear-gradient(180deg, 
        rgba(255, 69, 0, 0.25) 0%, 
        rgba(255, 140, 0, 0.18) 40%, 
        rgba(255, 200, 0, 0.1) 80%,
        rgba(0,0,0,0.2) 100%) !important;
    box-shadow: 
        0 0 20px rgba(255, 69, 0, 0.5),
        0 0 40px rgba(255, 140, 0, 0.25),
        inset 0 -20px 30px rgba(255, 69, 0, 0.2) !important;
    animation: fireGlow 1.2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.chat-message-box.chat-effect-fire::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff4500, #ff8c00, #ffd700, #ff8c00, #ff4500);
    background-size: 200% 100%;
    animation: fireWave 0.8s linear infinite;
    pointer-events: none;
    filter: blur(1px);
}

.chat-message-box.chat-effect-fire::after {
    content: '🔥';
    position: absolute;
    bottom: -5px;
    right: 10px;
    font-size: 18px;
    opacity: 0.8;
    animation: fireEmoji 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 69, 0, 0.8));
}

@keyframes fireGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 69, 0, 0.5), 0 0 40px rgba(255, 140, 0, 0.25), inset 0 -20px 30px rgba(255, 69, 0, 0.2) !important; }
    50% { box-shadow: 0 0 35px rgba(255, 140, 0, 0.7), 0 0 60px rgba(255, 200, 0, 0.35), inset 0 -25px 40px rgba(255, 69, 0, 0.3) !important; }
}

@keyframes fireWave {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

@keyframes fireEmoji {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.8; }
    50% { transform: translateY(-5px) scale(1.1); opacity: 1; }
}

/* ❄️ Ice Effect */
.chat-message-box.chat-effect-ice {
    border: 2px solid #87ceeb !important;
    background: linear-gradient(180deg, 
        rgba(135, 206, 235, 0.25) 0%, 
        rgba(173, 216, 230, 0.18) 50%, 
        rgba(200, 230, 255, 0.12) 100%) !important;
    box-shadow: 
        0 0 25px rgba(135, 206, 235, 0.5),
        0 0 50px rgba(200, 230, 255, 0.25),
        inset 0 0 30px rgba(255, 255, 255, 0.1) !important;
    position: relative;
    overflow: hidden;
}

.chat-message-box.chat-effect-ice::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%, rgba(135, 206, 235, 0.2) 100%);
    animation: iceShimmer 4s ease-in-out infinite;
    pointer-events: none;
}

.chat-message-box.chat-effect-ice::after {
    content: '❄️';
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 14px;
    opacity: 0.7;
    animation: iceFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(135, 206, 235, 0.8));
}

@keyframes iceShimmer {
    0%, 100% { opacity: 0.5; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(10px); }
}

@keyframes iceFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(15deg); }
}

/* 🌈 Rainbow Effect */
.chat-message-box.chat-effect-rainbow {
    border: 3px solid transparent !important;
    background: linear-gradient(rgba(26, 26, 46, 0.95), rgba(26, 26, 46, 0.95)) padding-box,
                linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #8b00ff, #ff0000) border-box !important;
    animation: rainbowBorder 2s linear infinite;
    background-size: 300% 100%;
    box-shadow: 
        0 0 20px rgba(255, 100, 100, 0.4),
        0 0 40px rgba(100, 255, 100, 0.2),
        0 0 60px rgba(100, 100, 255, 0.2) !important;
    position: relative;
    overflow: hidden;
}

.chat-message-box.chat-effect-rainbow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(255, 0, 0, 0.08), 
        rgba(255, 127, 0, 0.08), 
        rgba(255, 255, 0, 0.08), 
        rgba(0, 255, 0, 0.08), 
        rgba(0, 0, 255, 0.08), 
        rgba(139, 0, 255, 0.08));
    background-size: 300% 300%;
    animation: rainbowGlow 3s ease infinite;
    pointer-events: none;
}

@keyframes rainbowBorder {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

@keyframes rainbowGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 🌟 Gold Effect */
.chat-message-box.chat-effect-gold {
    border: 2px solid #ffd700 !important;
    background: linear-gradient(135deg, 
        rgba(255, 215, 0, 0.25) 0%, 
        rgba(218, 165, 32, 0.18) 50%, 
        rgba(255, 215, 0, 0.12) 100%) !important;
    box-shadow: 
        0 0 30px rgba(255, 215, 0, 0.5),
        0 0 60px rgba(218, 165, 32, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    position: relative;
    overflow: hidden;
}

.chat-message-box.chat-effect-gold::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.5), rgba(255, 255, 255, 0.3), transparent);
    animation: goldShine 2.5s ease-in-out infinite;
    pointer-events: none;
}

.chat-message-box.chat-effect-gold::after {
    content: '✨';
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 14px;
    animation: goldSparkle 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

@keyframes goldShine {
    0% { left: -100%; }
    50%, 100% { left: 150%; }
}

@keyframes goldSparkle {
    0%, 100% { opacity: 0.5; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* 🌌 Plasma Effect */
.chat-message-box.chat-effect-plasma {
    border: 2px solid #ff00ff !important;
    background: linear-gradient(135deg, 
        rgba(255, 0, 255, 0.2) 0%, 
        rgba(0, 255, 255, 0.18) 50%, 
        rgba(255, 0, 255, 0.15) 100%) !important;
    box-shadow: 
        0 0 25px rgba(255, 0, 255, 0.5),
        0 0 50px rgba(0, 255, 255, 0.25) !important;
    animation: plasmaShift 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.chat-message-box.chat-effect-plasma::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 0, 255, 0.3), transparent, rgba(0, 255, 255, 0.3), transparent);
    animation: plasmaRotate 4s linear infinite;
    pointer-events: none;
}

@keyframes plasmaShift {
    0%, 100% { 
        box-shadow: 0 0 25px rgba(255, 0, 255, 0.5), 0 0 50px rgba(0, 255, 255, 0.25) !important;
        border-color: #ff00ff !important;
    }
    50% { 
        box-shadow: 0 0 25px rgba(0, 255, 255, 0.5), 0 0 50px rgba(255, 0, 255, 0.25) !important;
        border-color: #00ffff !important;
    }
}

@keyframes plasmaRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 🌌 Galaxy Effect */
.chat-message-box.chat-effect-galaxy {
    border: 2px solid #8b5cf6 !important;
    background: linear-gradient(135deg, 
        rgba(139, 92, 246, 0.25) 0%, 
        rgba(59, 130, 246, 0.18) 40%, 
        rgba(236, 72, 153, 0.15) 80%,
        rgba(139, 92, 246, 0.1) 100%) !important;
    box-shadow: 
        0 0 30px rgba(139, 92, 246, 0.5),
        0 0 60px rgba(59, 130, 246, 0.25),
        0 0 90px rgba(236, 72, 153, 0.15) !important;
    position: relative;
    overflow: hidden;
}

.chat-message-box.chat-effect-galaxy::before {
    content: '✨';
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 14px;
    animation: starTwinkle 1.5s ease-in-out infinite;
    pointer-events: none;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

.chat-message-box.chat-effect-galaxy::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 20% 80%, rgba(139, 92, 246, 0.15), transparent 50%),
                radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.15), transparent 50%);
    animation: galaxyPulse 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.5; transform: scale(0.8) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.3) rotate(180deg); }
}

@keyframes galaxyPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* 🤖 Cyber Effect */
.chat-message-box.chat-effect-cyber {
    border: 2px solid #00ff41 !important;
    background: linear-gradient(180deg, 
        rgba(0, 255, 65, 0.15) 0%, 
        rgba(0, 200, 50, 0.1) 50%, 
        rgba(0, 100, 25, 0.08) 100%) !important;
    box-shadow: 
        0 0 20px rgba(0, 255, 65, 0.4),
        0 0 40px rgba(0, 200, 50, 0.2),
        inset 0 0 20px rgba(0, 255, 65, 0.05) !important;
    position: relative;
    overflow: hidden;
}

.chat-message-box.chat-effect-cyber::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #00ff41, #00ff88, #00ff41, transparent);
    animation: cyberScan 1.5s linear infinite;
    pointer-events: none;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.8);
}

.chat-message-box.chat-effect-cyber::after {
    content: '⚡';
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 14px;
    opacity: 0.8;
    animation: cyberGlitch 2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(0, 255, 65, 0.8));
}

@keyframes cyberScan {
    0% { opacity: 0.3; transform: translateX(-100%); }
    50% { opacity: 1; }
    100% { opacity: 0.3; transform: translateX(100%); }
}

@keyframes cyberGlitch {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-2px); }
    20% { transform: translateX(2px); }
    30% { transform: translateX(0); }
}

/* 🟩 Matrix Effect */
.chat-message-box.chat-effect-matrix {
    border: 2px solid #00ff00 !important;
    background: rgba(0, 20, 0, 0.92) !important;
    box-shadow: 0 0 18px rgba(0, 255, 0, 0.35), inset 0 0 18px rgba(0, 255, 0, 0.08) !important;
    position: relative;
    overflow: hidden;
}

.chat-message-box.chat-effect-matrix::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        180deg,
        rgba(0, 255, 0, 0.10) 0px,
        rgba(0, 255, 0, 0.02) 2px,
        transparent 6px,
        transparent 10px
    );
    opacity: 0.6;
    animation: matrixScan 1.8s linear infinite;
    pointer-events: none;
}

.chat-message-box.chat-effect-matrix::after {
    content: '01';
    position: absolute;
    top: 5px;
    right: 10px;
    font-family: monospace;
    font-size: 12px;
    color: #00ff00;
    opacity: 0.7;
    animation: matrixDigits 1s steps(10) infinite;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

@keyframes matrixScan {
    0% { transform: translateY(-30%); }
    100% { transform: translateY(30%); }
}

@keyframes matrixDigits {
    0% { content: '01'; }
    25% { content: '10'; }
    50% { content: '11'; }
    75% { content: '00'; }
    100% { content: '01'; }
}

/* 🕶️ Shadow Effect */
.chat-message-box.chat-effect-shadow {
    border: 2px solid #1a1a2e !important;
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.95), rgba(10, 10, 15, 0.95)) !important;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.8), inset 0 0 22px rgba(0, 0, 0, 0.55) !important;
    position: relative;
    overflow: hidden;
}

.chat-message-box.chat-effect-shadow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
    animation: shadowPulse 3s ease-in-out infinite;
    pointer-events: none;
}

.chat-message-box.chat-effect-shadow::after {
    content: '👻';
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 14px;
    opacity: 0.5;
    animation: shadowFloat 2s ease-in-out infinite;
}

@keyframes shadowPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

@keyframes shadowFloat {
    0%, 100% { transform: translateY(0); opacity: 0.3; }
    50% { transform: translateY(-3px); opacity: 0.6; }
}

/* ⚡ Lightning Effect */
.chat-message-box.chat-effect-lightning {
    border: 2px solid #ffff00 !important;
    background: linear-gradient(135deg, 
        rgba(255, 255, 0, 0.15) 0%, 
        rgba(255, 200, 0, 0.1) 50%, 
        rgba(255, 255, 0, 0.08) 100%) !important;
    box-shadow: 
        0 0 25px rgba(255, 255, 0, 0.5),
        0 0 50px rgba(255, 200, 0, 0.25) !important;
    position: relative;
    overflow: hidden;
}

.chat-message-box.chat-effect-lightning::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: lightningFlash 2s ease-in-out infinite;
    pointer-events: none;
}

.chat-message-box.chat-effect-lightning::after {
    content: '⚡';
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 14px;
    animation: lightningBolt 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 255, 0, 0.8));
}

@keyframes lightningFlash {
    0%, 100% { left: -100%; opacity: 0; }
    50% { left: 150%; opacity: 1; }
}

@keyframes lightningBolt {
    0%, 100% { opacity: 0.5; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ========== 💎 AVATAR BORDER EFFECTS ========== */
/* Same as live-chat for consistency */

.chat-avatar-border {
    position: relative;
    border-radius: 50%;
    padding: 3px;
    transition: all 0.3s ease;
}

.chat-avatar-border:hover {
    transform: scale(1.1);
}

.chat-avatar-border img,
.chat-avatar-border > div {
    position: relative;
    z-index: 1;
    border-radius: 50%;
}

/* 🌈 Rainbow Border */
.avatar-border-rainbow {
    background: conic-gradient(from 0deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #8b00ff, #ff0000);
    animation: avatarBorderRotate 1.5s linear infinite;
    box-shadow: 0 0 15px rgba(255, 100, 100, 0.6), 0 0 30px rgba(100, 255, 100, 0.3);
}

.avatar-border-rainbow:hover {
    box-shadow: 0 0 25px rgba(255, 100, 100, 0.8), 0 0 50px rgba(100, 255, 100, 0.5);
}

/* 💠 Neon Border */
.avatar-border-neon {
    background: linear-gradient(45deg, #00ffff, #ff00ff, #00ffff);
    background-size: 200% 200%;
    animation: avatarNeonPulse 1.5s ease-in-out infinite, avatarNeonGradient 3s linear infinite;
    box-shadow: 0 0 12px #00ffff, 0 0 25px rgba(0, 255, 255, 0.6), 0 0 40px rgba(255, 0, 255, 0.3);
}

@keyframes avatarNeonGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes avatarNeonPulse {
    0%, 100% { box-shadow: 0 0 8px #00ffff, 0 0 15px rgba(0, 255, 255, 0.5); }
    50% { box-shadow: 0 0 15px #00ffff, 0 0 25px rgba(0, 255, 255, 0.8); }
}

/* 🔥 Fire Border */
.avatar-border-fire {
    background: conic-gradient(from 0deg, #ff4500, #ff8c00, #ffd700, #ff8c00, #ff4500);
    animation: avatarBorderRotate 1s linear infinite, avatarFireFlicker 0.3s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(255, 69, 0, 0.7), 0 0 30px rgba(255, 140, 0, 0.5);
}

@keyframes avatarFireFlicker {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

/* ❄️ Frost/Ice Border */
.avatar-border-frost {
    background: conic-gradient(from 0deg, #00bfff, #87ceeb, #ffffff, #e0ffff, #87ceeb, #00bfff);
    animation: avatarBorderRotate 2.5s linear infinite reverse;
    box-shadow: 0 0 15px rgba(135, 206, 235, 0.7), 0 0 30px rgba(0, 191, 255, 0.4);
}

/* 🌟 Gold Border */
.avatar-border-gold {
    background: conic-gradient(from 0deg, #ffd700, #ffec8b, #fff8dc, #ffec8b, #daa520, #ffd700);
    animation: avatarBorderRotate 3s linear infinite, avatarGoldShine 2s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.7), 0 0 30px rgba(218, 165, 32, 0.5);
}

@keyframes avatarGoldShine {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.4); }
}

/* ⚡ Electric Border */
.avatar-border-electric {
    background: conic-gradient(from 0deg, transparent 0deg, #00ff88 15deg, transparent 30deg, transparent 90deg, #ffff00 105deg, transparent 120deg, transparent 180deg, #00ff88 195deg, transparent 210deg, transparent 270deg, #ffff00 285deg, transparent 300deg);
    animation: avatarElectricSpin 0.3s linear infinite;
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.8), 0 0 30px rgba(0, 255, 136, 0.5);
}

@keyframes avatarElectricSpin {
    0% { transform: rotate(0deg); filter: brightness(1); }
    50% { filter: brightness(1.8); }
    100% { transform: rotate(360deg); filter: brightness(1); }
}

/* 🌌 Plasma Border */
.avatar-border-plasma {
    background: conic-gradient(from 0deg, #ff00ff, #00ffff, #ff00ff, #ffff00, #ff00ff);
    animation: avatarBorderRotate 1s linear infinite;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.6), 0 0 30px rgba(0, 255, 255, 0.4);
}

/* 💎 Diamond Border */
.avatar-border-diamond {
    background: conic-gradient(from 0deg, #e0ffff, #ffffff, #b0e0e6, #ffffff, #e0ffff, #ffffff, #b0e0e6, #ffffff, #e0ffff);
    animation: avatarBorderRotate 4s linear infinite, avatarDiamondSparkle 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(224, 255, 255, 0.8), 0 0 40px rgba(176, 224, 230, 0.5);
}

@keyframes avatarDiamondSparkle {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

/* 💠 Ion Border */
.avatar-border-ion {
    background: radial-gradient(circle, #00ff00 0%, #00ffff 40%, #0088ff 70%, #0000ff 100%);
    animation: avatarIonPulse 0.8s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.6), 0 0 30px rgba(0, 255, 255, 0.4);
}

@keyframes avatarIonPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 🌌 Nebula Border */
.avatar-border-nebula {
    background: conic-gradient(from 0deg, #8b00ff, #ff1493, #00bfff, #8b00ff);
    animation: avatarBorderRotate 6s linear infinite;
    box-shadow: 0 0 15px rgba(139, 0, 255, 0.5);
}

@keyframes avatarBorderRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== 👤 USER PROFILE MODAL ========== */

.user-profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.user-profile-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Scoped to legacy overlay only — DO NOT match the standalone
   `.user-profile-modal#userProfileModal` used on index.html, otherwise it
   collapses the fullscreen overlay (transform: scale(.9), max-width, etc.)
   and the modal appears tiny / mis-positioned when opened from chat. */
.user-profile-modal-overlay .user-profile-modal {
    background: linear-gradient(145deg, rgba(30, 30, 50, 0.98), rgba(20, 20, 35, 0.98));
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.user-profile-modal-overlay.active .user-profile-modal {
    transform: scale(1);
}

.user-profile-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.user-profile-modal-close:hover {
    background: rgba(255, 64, 129, 0.3);
    transform: rotate(90deg);
}

.user-profile-avatar-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.user-profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.user-profile-name {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.user-profile-badges {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.user-profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.user-profile-stat {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.user-profile-stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #ff4081;
}

.user-profile-stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
}

.user-profile-chat-demo {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
}

.user-profile-chat-demo-title {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========== Standalone User Profile Modal ========== */
#userProfileModal.user-profile-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100001;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(18px);
}

#userProfileModal.user-profile-modal.active {
    display: flex;
}

#userProfileModal .user-profile-content {
    position: relative;
    width: min(420px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 16px;
    background: linear-gradient(180deg, #0a0a0f 0%, #12121a 52%, #0d0d14 100%);
    border: 1px solid rgba(255, 45, 85, 0.32);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.82), 0 0 70px rgba(255, 45, 85, 0.16);
}

#userProfileModal .user-profile-content::-webkit-scrollbar {
    width: 8px;
}

#userProfileModal .user-profile-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

#userProfileModal .user-profile-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ff2d55, #ff6600);
    border-radius: 8px;
}

#userProfileModal .user-profile-bg-canvas,
#userProfileModal .profile-bg-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#userProfileModal .user-profile-bg-canvas {
    z-index: 0;
    opacity: 0.68;
}

#userProfileModal .profile-bg-overlay {
    z-index: 1;
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.45), rgba(10, 10, 15, 0.86) 42%, rgba(10, 10, 15, 0.96));
}

#userProfileModal .user-profile-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 50;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

#userProfileModal .user-profile-close-btn:hover {
    background: rgba(255, 45, 85, 0.86);
    color: #fff;
    transform: rotate(90deg);
}

#userProfileModal .profile-header-section,
#userProfileModal .profile-xp-section,
#userProfileModal .profile-stats-grid,
#userProfileModal .profile-info-container {
    position: relative;
    z-index: 10;
}

#userProfileModal .profile-header-section {
    padding: 40px 24px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#userProfileModal .profile-avatar-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#userProfileModal .profile-avatar-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: conic-gradient(from 0deg, #ff2d55, #ff6600, #ffcc00, #ff6600, #ff2d55);
    filter: blur(12px);
    opacity: 0.55;
    z-index: 0;
}

#userProfileModal .profile-avatar-hexagon {
    position: relative;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    padding: 5px;
    z-index: 2;
    background: linear-gradient(135deg, #ff2d55, #ff6600);
    box-shadow: 0 0 30px rgba(255, 45, 85, 0.45), 0 10px 40px rgba(0, 0, 0, 0.5);
}

#userProfileModal .profile-avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: #1a1a2e;
}

#userProfileModal .profile-avatar-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#userProfileModal .profile-online-indicator {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 4px solid #0a0a0f;
    z-index: 3;
}

#userProfileModal .profile-username {
    margin: 0;
    color: #fff;
    font-size: 1.8rem;
    font-weight: 800;
    text-shadow: 0 2px 20px rgba(255, 45, 85, 0.45);
}

#userProfileModal .profile-badges,
#userProfileModal .profile-rank-cards,
#userProfileModal .status-row,
#userProfileModal .profile-status-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

#userProfileModal .badge-verified,
#userProfileModal .badge-admin {
    display: none;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
}

#userProfileModal .badge-verified {
    background: linear-gradient(135deg, #5865f2, #7289da);
    color: #fff;
}

#userProfileModal .badge-admin {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
}

#userProfileModal .profile-status-row {
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
}

#userProfileModal .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #43b581;
}

#userProfileModal .status-text {
    color: #43b581;
    font-size: 13px;
    font-weight: 700;
}

#userProfileModal .status-activity {
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
}

#userProfileModal .rank-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 800;
}

#userProfileModal .level-card {
    background: rgba(255, 45, 85, 0.16);
    border: 1px solid rgba(255, 45, 85, 0.3);
    color: #ff6600;
}

#userProfileModal .tier-card {
    background: rgba(255, 215, 0, 0.14);
    border: 1px solid rgba(255, 215, 0, 0.26);
    color: #ffd700;
}

#userProfileModal .profile-xp-section,
#userProfileModal .profile-stats-grid,
#userProfileModal .profile-info-container {
    padding-left: 24px;
    padding-right: 24px;
}

#userProfileModal .profile-xp-section {
    padding-bottom: 20px;
}

#userProfileModal .xp-bar-container {
    position: relative;
    height: 8px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

#userProfileModal .xp-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 10px;
    background: linear-gradient(90deg, #ff2d55, #ff6600, #ffcc00);
}

#userProfileModal .xp-text {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 6px;
    font-size: 11px;
}

#userProfileModal .xp-current { color: #ff6600; font-weight: 800; }
#userProfileModal .xp-separator { color: rgba(255, 255, 255, 0.35); }
#userProfileModal .xp-max { color: rgba(255, 255, 255, 0.55); }

#userProfileModal .profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-bottom: 20px;
}

#userProfileModal .stat-card,
#userProfileModal .profile-card,
#userProfileModal .profile-member-badge {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

#userProfileModal .stat-card {
    padding: 14px 10px;
    text-align: center;
}

#userProfileModal .stat-icon { font-size: 22px; margin-bottom: 8px; }
#userProfileModal .stat-value { color: #fff; font-size: 1.45rem; font-weight: 900; }
#userProfileModal #userProfileHours { font-size: clamp(1rem, 4vw, 1.35rem); line-height: 1.15; white-space: nowrap; }
#userProfileModal .stat-label { margin-top: 4px; color: rgba(255, 255, 255, 0.55); font-size: 10px; text-transform: uppercase; }

#userProfileModal .profile-info-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 24px;
}

#userProfileModal .profile-member-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}

#userProfileModal .profile-card {
    padding: 16px;
}

#userProfileModal .card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

#userProfileModal .card-title {
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

#userProfileModal .about-card,
#userProfileModal .consoles-card { border-left: 3px solid #ff2d55; }
#userProfileModal .trophy-card { border-left: 3px solid #ffd700; }
#userProfileModal .games-card { border-left: 3px solid #00d4ff; }
#userProfileModal .activity-card { border-left: 3px solid #22c55e; }
#userProfileModal .activity-card .card-title { color: #4ade80; }

#userProfileModal .trophy-grid,
#userProfileModal .consoles-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#userProfileModal .trophy-item,
#userProfileModal .console-tag {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
}

#userProfileModal .trophy-item {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

#userProfileModal .console-tag {
    color: #ff6b6b;
    background: rgba(255, 45, 85, 0.1);
    border: 1px solid rgba(255, 45, 85, 0.2);
}

#userProfileModal .activity-day-list,
#userProfileModal .games-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#userProfileModal .activity-day-row,
#userProfileModal .game-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.14);
}

#userProfileModal .activity-day-main { min-width: 0; }
#userProfileModal .activity-day-date { color: #fff; font-size: 12px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#userProfileModal .activity-day-meta { margin-top: 3px; color: rgba(255, 255, 255, 0.45); font-size: 10px; }
#userProfileModal .activity-day-time { color: #4ade80; font-size: 12px; font-weight: 900; white-space: nowrap; }

#userProfileModal .game-item {
    grid-template-columns: 42px minmax(0, 1fr);
    background: rgba(0, 212, 255, 0.055);
    border-color: rgba(0, 212, 255, 0.12);
}

#userProfileModal .game-cover-thumb,
#userProfileModal .game-icon {
    width: 42px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #0f0f1a);
    border: 1px solid rgba(0, 212, 255, 0.28);
}

#userProfileModal .game-cover-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#userProfileModal .cover-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.3rem;
}

#userProfileModal .game-info { min-width: 0; }
#userProfileModal .game-name { color: #fff; font-size: 12px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#userProfileModal .game-meta { margin-top: 3px; color: rgba(255, 255, 255, 0.45); font-size: 10px; line-height: 1.3; }
#userProfileModal .no-games { color: rgba(255, 255, 255, 0.45); font-size: 12px; text-align: center; padding: 14px; }

@media (max-width: 480px) {
    #userProfileModal.user-profile-modal { padding: 10px; }
    #userProfileModal .profile-stats-grid { gap: 8px; padding-left: 16px; padding-right: 16px; }
    #userProfileModal .profile-info-container,
    #userProfileModal .profile-xp-section { padding-left: 16px; padding-right: 16px; }
    #userProfileModal .stat-value { font-size: 1.15rem; }
    #userProfileModal .profile-username { font-size: 1.45rem; }
}

/* Live chat emoji picker and message timestamp polish */
.live-chat .chat-input-container {
    position: relative;
}

.live-chat .chat-input-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 12px;
    align-items: center;
    position: relative;
}

.live-chat .chat-input {
    width: 100%;
    min-width: 0;
    padding-left: 56px;
    box-sizing: border-box;
}

.live-chat .emoji-picker-btn {
    appearance: none;
    -webkit-appearance: none;
    position: absolute !important;
    left: 11px;
    top: 50%;
    z-index: 3;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
    box-shadow: none !important;
    outline: none;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif !important;
    font-size: 1.18rem !important;
    line-height: 1 !important;
    transform: translateY(-50%);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.live-chat .emoji-picker-btn:hover,
.live-chat .emoji-picker-btn:focus-visible {
    background: rgba(255, 0, 64, 0.22) !important;
    box-shadow: 0 0 18px rgba(255, 0, 64, 0.28) !important;
    transform: translateY(-50%) scale(1.08);
}

.live-chat .emoji-picker-panel {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: calc(100% - 4px);
    max-height: 320px;
    margin-bottom: 8px;
    background: linear-gradient(160deg, #13111a 0%, #1a0f1e 100%);
    border: 1.5px solid rgba(255, 0, 64, 0.25);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    z-index: 100;
    flex-direction: column;
}

.live-chat .emoji-picker-header {
    padding: 10px 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.live-chat .emoji-search-wrapper {
    position: relative;
    margin-bottom: 8px;
}

.live-chat .emoji-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0.6;
}

.live-chat .emoji-search {
    width: 100%;
    padding: 9px 12px 9px 34px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
    box-sizing: border-box;
}

.live-chat .emoji-search::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.live-chat .emoji-cat-bar {
    display: flex;
    gap: 2px;
    padding: 6px 0 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.live-chat .emoji-cat-bar::-webkit-scrollbar {
    display: none;
}

.live-chat .emoji-cat-btn,
.live-chat .emoji-item {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    box-shadow: none;
    color: inherit;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif !important;
}

.live-chat .emoji-cat-btn {
    background: transparent;
    padding: 5px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.15rem;
    flex-shrink: 0;
    border-bottom: 2px solid transparent;
    line-height: 1;
}

.live-chat .emoji-cat-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.live-chat .emoji-cat-btn.active {
    background: rgba(255, 0, 64, 0.15);
    border-bottom-color: #ff0040;
}

.live-chat .emoji-grid {
    max-height: 200px;
    overflow-y: auto;
    padding: 8px 10px 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 0, 64, 0.4) transparent;
}

.live-chat .emoji-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 6px;
    padding-bottom: 3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.live-chat .emoji-items {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    margin-bottom: 4px;
}

.live-chat .emoji-item {
    background: transparent;
    cursor: pointer;
    font-size: 1.3rem;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.live-chat .emoji-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.18);
}

.live-chat .chat-date-separator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.live-chat .chat-date-separator::before,
.live-chat .chat-date-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 0, 64, 0.3), transparent);
}

.live-chat .chat-date-separator span {
    background: rgba(255, 0, 64, 0.14);
    border: 1px solid rgba(255, 0, 64, 0.24);
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.live-chat .chat-msg-datetime {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 7px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
}

.live-chat .chat-msg-datetime span + span::before {
    content: '•';
    margin-right: 7px;
    color: rgba(255, 255, 255, 0.28);
}

.live-chat .chat-msg-time .chat-msg-hour {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.52);
}

@media (max-width: 520px) {
    .live-chat .chat-input-wrapper {
        grid-template-columns: minmax(0, 1fr) 50px;
        gap: 10px;
    }

    .live-chat .emoji-picker-panel {
        left: 12px;
        right: 12px;
        max-height: 300px;
    }
}



/* ============================================================================
   Live chat performance: paint only what's visible
   --------------------------------------------------------------------------
   `content-visibility: auto` lets the browser skip layout, style, and paint
   for off-screen messages until they scroll into view. Combined with the
   `contain-intrinsic-size` hint (so scrollbar height doesn't jump as
   messages get virtualized) this makes opening a chat with 50 cached
   messages feel instant on low-end devices.
============================================================================ */
.chat-message-box {
    content-visibility: auto;
    contain-intrinsic-size: auto 64px;
    contain: layout paint style;
}

/* messagesList scroll container — let the browser parallelize layout. */
#messagesList {
    contain: layout paint style;
}


/* ════════════════════════════════════════════════════════════
   💬 Typing indicator
   Inserted just above .chat-input-container by live-chat.js
   when one or more other users are composing a message.
   ════════════════════════════════════════════════════════════ */
.chat-typing-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    margin: 0 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px 10px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    line-height: 1.2;
    pointer-events: none;
    user-select: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.chat-typing-indicator .chat-typing-label {
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-typing-indicator .chat-typing-dots {
    display: inline-flex;
    align-items: flex-end;
    gap: 3px;
    height: 12px;
}

.chat-typing-indicator .chat-typing-dots span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--red, #ff0040);
    opacity: 0.5;
    animation: chatTypingBounce 1.1s infinite ease-in-out;
}

.chat-typing-indicator .chat-typing-dots span:nth-child(2) {
    animation-delay: 0.15s;
}
.chat-typing-indicator .chat-typing-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes chatTypingBounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    40% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .chat-typing-indicator .chat-typing-dots span {
        animation: none;
    }
}

/* ============================================================
   PROFILE MODAL — STORE BACKGROUND EFFECTS (ported for /games)
   The bg-* classes live in main.css which is NOT loaded on the
   /games portal. These modal-native versions fill the whole
   profile panel with the purchased background so users see their
   `profileBgEffect` exactly like on the home page.
   ============================================================ */
#userProfileModal .user-profile-bg-effect {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.4s ease;
}
/* When a bg-* class is applied, reveal the layer and dim the dark overlay
   (handled in JS) so the effect stays visible behind the content. */
#userProfileModal .user-profile-bg-effect[class*="bg-"] {
    opacity: 1;
}

#userProfileModal .user-profile-bg-effect.bg-cosmic-void {
    background:
        radial-gradient(ellipse at 30% 15%, rgba(138, 43, 226, 0.55) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 70%, rgba(0, 191, 255, 0.45) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 45%, rgba(255, 20, 147, 0.30) 0%, transparent 60%),
        linear-gradient(180deg, #0a0015 0%, #1a0a2e 50%, #0d001a 100%);
    background-size: 180% 180%, 180% 180%, 200% 200%, 100% 100%;
    animation: ogpBgDrift 16s ease-in-out infinite;
}
#userProfileModal .user-profile-bg-effect.bg-cosmic-void::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(2px 2px at 20% 30%, #fff, transparent),
        radial-gradient(2px 2px at 40% 70%, #fff, transparent),
        radial-gradient(3px 3px at 60% 20%, rgba(255,255,255,.8), transparent),
        radial-gradient(2px 2px at 80% 60%, #fff, transparent),
        radial-gradient(3px 3px at 12% 82%, rgba(255,255,255,.9), transparent),
        radial-gradient(2px 2px at 88% 40%, #fff, transparent);
    animation: ogpTwinkle 3.5s ease-in-out infinite;
}

#userProfileModal .user-profile-bg-effect.bg-neon-glow {
    background:
        radial-gradient(ellipse at center, rgba(0, 255, 255, 0.30) 0%, transparent 45%),
        radial-gradient(ellipse at 20% 80%, rgba(255, 0, 255, 0.40) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 255, 128, 0.28) 0%, transparent 55%),
        linear-gradient(45deg, #000428, #004e92, #000428);
    background-size: 160% 160%, 160% 160%, 160% 160%, 200% 200%;
    animation: ogpBgDrift 12s ease-in-out infinite;
}

#userProfileModal .user-profile-bg-effect.bg-sunset-aura {
    background:
        radial-gradient(ellipse at 30% 30%, rgba(255, 165, 0, 0.55) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 70%, rgba(255, 69, 0, 0.50) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 20, 60, 0.40) 0%, transparent 60%),
        linear-gradient(135deg, #2a0a1a 0%, #4d1500 50%, #2a0a00 100%);
    background-size: 170% 170%, 170% 170%, 200% 200%, 100% 100%;
    animation: ogpBgDrift 14s ease-in-out infinite;
}

#userProfileModal .user-profile-bg-effect.bg-mystic-purple {
    background:
        radial-gradient(ellipse at 25% 25%, rgba(186, 85, 211, 0.55) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 75%, rgba(138, 43, 226, 0.50) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 0, 255, 0.30) 0%, transparent 55%),
        linear-gradient(180deg, #1a0033 0%, #4a0080 50%, #2d0066 100%);
    background-size: 180% 180%, 180% 180%, 200% 200%, 100% 100%;
    animation: ogpBgDrift 18s ease-in-out infinite;
}

#userProfileModal .user-profile-bg-effect.bg-matrix-digital {
    background:
        radial-gradient(ellipse at center, rgba(0, 255, 65, 0.28) 0%, transparent 60%),
        linear-gradient(180deg, #001100 0%, #003300 50%, #001100 100%);
}
#userProfileModal .user-profile-bg-effect.bg-matrix-digital::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 12px, rgba(0,255,65,.12) 12px, rgba(0,255,65,.12) 14px);
    animation: ogpMatrixScan 6s linear infinite;
}

#userProfileModal .user-profile-bg-effect.bg-golden-prestige {
    background:
        radial-gradient(ellipse at 30% 30%, rgba(255, 215, 0, 0.50) 0%, transparent 45%),
        radial-gradient(ellipse at 70% 70%, rgba(255, 193, 7, 0.45) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 165, 0, 0.32) 0%, transparent 55%),
        linear-gradient(135deg, #2a1f00 0%, #4d3800 50%, #1f1600 100%);
    background-size: 170% 170%, 170% 170%, 200% 200%, 100% 100%;
    animation: ogpBgDrift 15s ease-in-out infinite;
}

#userProfileModal .user-profile-bg-effect.bg-inferno-flame {
    background:
        radial-gradient(ellipse at 50% 85%, rgba(255, 69, 0, 0.65) 0%, transparent 55%),
        radial-gradient(ellipse at 30% 60%, rgba(255, 140, 0, 0.50) 0%, transparent 45%),
        radial-gradient(ellipse at 70% 60%, rgba(255, 165, 0, 0.45) 0%, transparent 45%),
        linear-gradient(180deg, #1a0000 0%, #330000 50%, #1a0000 100%);
    background-size: 160% 160%, 160% 160%, 160% 160%, 100% 100%;
    animation: ogpFlameFlicker 4s ease-in-out infinite;
}

#userProfileModal .user-profile-bg-effect.bg-frost-ice {
    background:
        radial-gradient(ellipse at 30% 30%, rgba(135, 206, 250, 0.50) 0%, transparent 45%),
        radial-gradient(ellipse at 70% 70%, rgba(0, 191, 255, 0.45) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 50%, rgba(173, 216, 230, 0.35) 0%, transparent 55%),
        linear-gradient(135deg, #001a33 0%, #004466 50%, #001a33 100%);
    background-size: 170% 170%, 170% 170%, 200% 200%, 100% 100%;
    animation: ogpBgDrift 16s ease-in-out infinite;
}
#userProfileModal .user-profile-bg-effect.bg-frost-ice::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(3px 3px at 20% 20%, rgba(255,255,255,.9), transparent),
        radial-gradient(4px 4px at 80% 30%, rgba(255,255,255,.8), transparent),
        radial-gradient(3px 3px at 30% 80%, rgba(255,255,255,.9), transparent),
        radial-gradient(5px 5px at 70% 70%, rgba(255,255,255,.7), transparent);
    animation: ogpTwinkle 2.5s ease-in-out infinite;
}

#userProfileModal .user-profile-bg-effect.bg-synthwave-dream {
    background: linear-gradient(180deg, #17002c 0%, #320042 50%, #03010a 100%);
    overflow: hidden;
}
#userProfileModal .user-profile-bg-effect.bg-synthwave-dream::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, rgba(255, 0, 128, 0.35), rgba(255, 0, 128, 0.35) 2px, transparent 2px, transparent 12px),
        repeating-linear-gradient(90deg, rgba(0, 255, 255, 0.25), rgba(0, 255, 255, 0.25) 2px, transparent 2px, transparent 16px);
    animation: ogpMatrixScan 7s linear infinite;
}

#userProfileModal .user-profile-bg-effect.bg-lunar-halo {
    background:
        radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.40) 0%, rgba(173, 216, 230, 0.20) 45%, transparent 70%),
        linear-gradient(180deg, #02040c 0%, #081526 100%);
    background-size: 150% 150%, 100% 100%;
    animation: ogpBgDrift 20s ease-in-out infinite;
}

@keyframes ogpBgDrift {
    0%, 100% { background-position: 0% 0%, 100% 100%, 50% 50%, 0 0; }
    50% { background-position: 20% 30%, 80% 60%, 40% 60%, 0 0; }
}
@keyframes ogpTwinkle {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}
@keyframes ogpMatrixScan {
    0% { transform: translateY(-30%); }
    100% { transform: translateY(30%); }
}
@keyframes ogpFlameFlicker {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.25); }
}

/* ============================================================
   PROFILE MODAL — AVATAR BORDER (store) COLOR VARIANTS
   The base .profile-avatar-glow shows a fixed red glow. These
   variants recolor it to match the user's purchased profileBorder
   so each border looks distinct (like the home page).
   ============================================================ */
#userProfileModal .profile-avatar-glow.border-rainbow-spin {
    background: conic-gradient(from 0deg, #ff0000, #ff8000, #ffff00, #00ff00, #00ffff, #0080ff, #8000ff, #ff00ff, #ff0000);
    opacity: 0.7;
    animation: ogpGlowSpin 3s linear infinite;
}
#userProfileModal .profile-avatar-glow.border-neon-pulse {
    background: conic-gradient(from 0deg, #00f0ff, #ff00ff, #00f0ff);
    opacity: 0.7;
    animation: ogpGlowPulse 1.6s ease-in-out infinite;
}
#userProfileModal .profile-avatar-glow.border-electric {
    background: conic-gradient(from 0deg, transparent 0deg, #00ff88 25deg, transparent 55deg, transparent 120deg, #00ff88 150deg, transparent 185deg, transparent 250deg, #00ff88 280deg, transparent 320deg);
    opacity: 0.75;
    animation: ogpGlowSpin 1.4s linear infinite;
}
#userProfileModal .profile-avatar-glow.border-golden-crown {
    background: conic-gradient(from 0deg, #ffd700, #ffec8b, #ffd700, #b8860b, #ffd700, #ffec8b, #ffd700);
    opacity: 0.75;
    animation: ogpGlowSpin 4s linear infinite;
}
#userProfileModal .profile-avatar-glow.border-diamond {
    background: conic-gradient(from 0deg, #b9f2ff, #ffffff, #7ad7f0, #ffffff, #b9f2ff);
    opacity: 0.7;
    animation: ogpGlowSpin 3.5s linear infinite;
}
#userProfileModal .profile-avatar-glow.border-fire-ring {
    background: conic-gradient(from 0deg, #ff4500, #ff8c00, #ffcc00, #ff4500, #ff0000, #ff8c00);
    opacity: 0.75;
    animation: ogpGlowSpin 2.5s linear infinite;
}
#userProfileModal .profile-avatar-glow.border-frost {
    background: conic-gradient(from 0deg, #87cefa, #e0ffff, #00bfff, #e0ffff, #87cefa);
    opacity: 0.7;
    animation: ogpGlowSpin 4s linear infinite;
}
#userProfileModal .profile-avatar-glow.border-plasma {
    background: conic-gradient(from 0deg, #8a2be2, #ff00ff, #00ffff, #8a2be2);
    opacity: 0.72;
    animation: ogpGlowSpin 2.8s linear infinite;
}
#userProfileModal .profile-avatar-glow.border-ion-core {
    background: conic-gradient(from 0deg, #00ffd5, #0088ff, #00ffd5, #0044ff, #00ffd5);
    opacity: 0.75;
    animation: ogpGlowPulse 1.8s ease-in-out infinite;
}
#userProfileModal .profile-avatar-glow.border-nebula-ring {
    background: conic-gradient(from 0deg, #ff00aa, #7a00ff, #00d4ff, #ff00aa);
    opacity: 0.75;
    animation: ogpGlowSpin 5s linear infinite;
}
@keyframes ogpGlowSpin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes ogpGlowPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); filter: blur(12px) brightness(1); }
    50% { transform: translate(-50%, -50%) scale(1.12); filter: blur(14px) brightness(1.4); }
}

/* Make the animated canvas background read more clearly (was too dim) */
#userProfileModal .user-profile-bg-canvas {
    opacity: 0.9;
}
#userProfileModal .profile-bg-overlay {
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.30), rgba(10, 10, 15, 0.72) 45%, rgba(10, 10, 15, 0.92));
}

@media (prefers-reduced-motion: reduce) {
    #userProfileModal .user-profile-bg-effect,
    #userProfileModal .user-profile-bg-effect::before,
    #userProfileModal .profile-avatar-glow {
        animation: none !important;
    }
}
