body {
    background: #0a0a0a;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    overflow: hidden;
}

#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #2a1515 50%, #0a0a0a 100%);
    z-index: 1;
}

/* Mosaic loader styles */
.mosaic-root {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 100;
    width: 80vw;
    max-width: 600px;
    aspect-ratio: 1 / 1;
}
.mosaic-root::before {
    content: '';
    display: block;
    padding-top: 100%;
}
.mosaic-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.mosaic-rect {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0a0a0a 0%, #1a0a0a 20%, #3a1515 45%, #2a1515 55%, #8b4444 80%, #0a0a0a 100%);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.13);
    overflow: visible;
    position: relative;
    opacity: 0;
    transition: opacity 300ms ease;
    backdrop-filter: blur(10px);
    background-attachment: fixed;
}
.mosaic-rect.visible { opacity: 1; }
.mosaic-tiles { position: absolute; left: 0; top: 0; right: 0; bottom: 0; }
.mosaic-tile {
    position: absolute;
    background: inherit;
    background-clip: padding-box;
    transform-origin: center center;
    will-change: transform, opacity, right, top;
    transition: transform 520ms cubic-bezier(.2,.9,.2,1), opacity 420ms ease, right 520ms cubic-bezier(.2,.9,.2,1), top 520ms cubic-bezier(.2,.9,.2,1);
    border-radius: 2px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset;
}

/* small visual tweak when assembled */
.mosaic-rect.visible { box-shadow: 0 18px 50px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255,255,255,0.02); }

/* Avatar frame styles - NFT Inspired Design */
.avatar-frame {
    position: absolute;
    top: 2%;
    left: 2%;
    width: 22%;
    height: 22%;
    max-width: 160px;
    max-height: 160px;
    min-width: 60px;
    min-height: 60px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8), 
                inset 0 1px 0 rgba(255, 255, 255, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    z-index: 10;
    opacity: 0;
    transform: scale(0.8);
    transition: all 400ms cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #1a0a0a 0%, #2a1515 100%);
    /* Animation properties */
    animation: frameEnergy 4s ease-in-out infinite alternate;
}

.avatar-frame.visible {
    opacity: 1;
    transform: scale(1);
    animation-play-state: running;
}

/* NFT-style energy animation */
@keyframes frameEnergy {
    0% {
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8), 
                    inset 0 1px 0 rgba(255, 255, 255, 0.2),
                    0 0 0 1px rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.8);
    }
    100% {
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8), 
                    inset 0 1px 0 rgba(255, 255, 255, 0.2),
                    0 0 20px 3px rgba(139, 68, 68, 0.8);
        border-color: rgba(139, 68, 68, 0.9);
    }
}

/* Hover effect with adaptive scaling */
.avatar-frame:hover {
    transform: scale(1.05);
    border-color: rgba(139, 68, 68, 1);
    animation-duration: 2.5s;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8), 
                inset 0 1px 0 rgba(255, 255, 255, 0.3),
                0 0 25px 4px rgba(139, 68, 68, 0.9);
}

/* NFT-style rotating border */
.avatar-frame::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid rgba(139, 68, 68, 0.4);
    animation: nftRotate 8s linear infinite;
    z-index: -1;
    opacity: 0;
    background: conic-gradient(from 0deg, rgba(0, 0, 0, 0) 0%, rgba(139, 68, 68, 0.8) 25%, rgba(139, 68, 68, 0.8) 75%, rgba(0, 0, 0, 0) 100%);
}

.avatar-frame.visible::before {
    opacity: 1;
}

@keyframes nftRotate {
    0% {
        transform: rotate(0deg);
        opacity: 0;
    }
    25% {
        transform: rotate(90deg);
        opacity: 0.5;
    }
    50% {
        transform: rotate(180deg);
        opacity: 1;
    }
    75% {
        transform: rotate(270deg);
        opacity: 0.5;
    }
    100% {
        transform: rotate(360deg);
        opacity: 0;
    }
}

/* Inner NFT glow effect */
.avatar-frame::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;
    height: 70%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 68, 68, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 300ms ease;
    z-index: 1;
}

.avatar-frame:hover::after {
    opacity: 1;
}

/* NFT-style image enhancement */
.avatar-frame img {
    animation: imgReveal 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 50%;
    filter: drop-shadow(0 0 5px rgba(139, 68, 68, 0.3));
}

@keyframes imgReveal {
    from {
        opacity: 0;
        transform: scale(1.2) rotate(-5deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* NFT Sticker styles - стикер привязан к рамке аватара! */
.nft-sticker-container {
    position: absolute;
    width: 60px;
    height: 60px;
    z-index: 999; /* Самый передний план - стикер поверх всего! */
    pointer-events: none;
    transition: transform 0.3s ease;
    transform: rotate(-45deg);
}

/* Позиционирование стикера - теперь стикер привязан к рамке аватара */
.nft-sticker-top-left {
    /* Позиция относительно рамки аватара */
    top: -5px; /* Смещение вверх от верхнего края рамки */
    left: -5px; /* Смещение влево от левого края рамки */
}

/* Адаптивность стикера - аналогично рамке аватара */
@media (max-width: 480px) {
    .nft-sticker-container {
        width: 40px;
        height: 40px;
        transform: rotate(-30deg);
    }
    .nft-sticker-top-left {
        top: -3px;
        left: -3px;
    }
}

@media (min-width: 481px) and (max-width: 767px) {
    .nft-sticker-container {
        width: 50px;
        height: 50px;
        transform: rotate(-35deg);
    }
    .nft-sticker-top-left {
        top: -4px;
        left: -4px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .nft-sticker-container {
        width: 55px;
        height: 55px;
        transform: rotate(-40deg);
    }
    .nft-sticker-top-left {
        top: -4px;
        left: -4px;
    }
}

@media (min-width: 1025px) {
    .nft-sticker-container {
        width: 60px;
        height: 60px;
        transform: rotate(-45deg);
    }
    .nft-sticker-top-left {
        top: -5px;
        left: -5px;
    }
}

/* Стикер в нижнем левом углу */
.nft-sticker-bottom-left {
    bottom: -15px; /* Смещение вниз от нижнего края рамки */
    left: -15px; /* Смещение влево от левого края рамки */
}

/* ИНСТРУКЦИИ ПО НАСТРОЙКЕ ПОЗИЦИИ СТИКЕРА:

   Чтобы переместить стикер, измените значения в .nft-sticker-top-right:

   1. Чтобы ПОДНЯТЬ стикер ВЫШЕ:
      - Уменьшите значение 'top' (например, 5px, 0px, -5px)

   2. Чтобы ОПУСТИТЬ стикер НИЖЕ:
      - Увеличьте значение 'top' (например, 15px, 20px, 25px)

   3. Чтобы СДВИНУТЬ стикер ПРАВЕЕ:
      - Уменьшите значение 'right' (например, 5px, 0px, -5px)

   4. Чтобы СДВИНУТЬ стикер ЛЕВЕЕ:
      - Увеличьте значение 'right' (например, 15px, 20px, 25px)

   5. Чтобы ИЗМЕНИТЬ УГОЛ вращения:
      - Измените 'transform: rotate(45deg)' в .nft-sticker-container
      - Например: rotate(30deg), rotate(60deg), rotate(0deg)

   6. Чтобы ИЗМЕНИТЬ РАЗМЕР стикера:
      - Измените width и height в .nft-sticker-container

   ПРИМЕРЫ:
   - Поднять выше и правее: top: 5px; right: 5px;
   - Опустить ниже и левее: top: 20px; right: 20px;
   - Убрать вращение: transform: rotate(0deg);
   - Увеличить размер: width: 80px; height: 80px;
*/

.nft-sticker-bottom-left {
    bottom: -10px;
    left: -10px;
}

/* Fallback sticker styles */
.nft-sticker {
    position: absolute;
    width: 40px;
    height: 40px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 11;
    pointer-events: none;
    animation: stickerBounce 3s ease-in-out infinite;
}

/* Адаптивность fallback стикера */
@media (max-width: 480px) {
    .nft-sticker {
        width: 30px;
        height: 30px;
    }
}

@media (min-width: 481px) and (max-width: 767px) {
    .nft-sticker {
        width: 35px;
        height: 35px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .nft-sticker {
        width: 40px;
        height: 40px;
    }
}

@media (min-width: 1025px) {
    .nft-sticker {
        width: 40px;
        height: 40px;
    }
}

@keyframes stickerBounce {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(5deg);
    }
    50% {
        transform: translateY(0) rotate(0deg);
    }
    75% {
        transform: translateY(-5px) rotate(-3deg);
    }
}

/* Inner NFT glow effect */
.avatar-frame::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;
    height: 70%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 68, 68, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 300ms ease;
    z-index: 1;
}

.avatar-frame:hover::after {
    opacity: 1;
}

.avatar-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Responsive avatar frame adjustments */
@media (max-width: 480px) {
    .avatar-frame {
        top: 3%;
        left: 3%;
        width: 25%;
        height: 25%;
        max-width: 100px;
        max-height: 100px;
        min-width: 50px;
        min-height: 50px;
        border-width: 3px;
        /* Faster animation on mobile */
        animation-duration: 2.5s;
    }
    
    .avatar-frame::before {
        border-width: 1.5px;
        animation-duration: 2s;
    }
}

@media (min-width: 481px) and (max-width: 767px) {
    .avatar-frame {
        top: 2.5%;
        left: 2.5%;
        width: 24%;
        height: 24%;
        max-width: 120px;
        max-height: 120px;
        min-width: 55px;
        min-height: 55px;
        border-width: 3px;
        animation-duration: 3s;
    }
    
    .avatar-frame::before {
        animation-duration: 2.5s;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .avatar-frame {
        top: 2.5%;
        left: 2.5%;
        width: 23%;
        height: 23%;
        max-width: 140px;
        max-height: 140px;
        min-width: 60px;
        min-height: 60px;
        border-width: 4px;
        animation-duration: 3.5s;
    }
    
    .avatar-frame::before {
        animation-duration: 3s;
    }
}

@media (min-width: 1025px) {
    .avatar-frame {
        top: 2%;
        left: 2%;
        width: 22%;
        height: 22%;
        max-width: 160px;
        max-height: 160px;
        min-width: 60px;
        min-height: 60px;
        border-width: 4px;
        animation-duration: 4s;
    }
    
    .avatar-frame::before {
        animation-duration: 3.5s;
    }
}
