/* ==========================================================================
   3D Particle Portrait Styles
   ========================================================================== */

.particle-portrait {
    position: relative;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 1;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    border-radius: var(--radius-md);
    overflow: visible;
    background: radial-gradient(
        circle at center,
        rgba(79, 38, 131, 0.1) 0%,
        transparent 70%
    );
    min-height: 320px;
}

@media (min-width: 500px) {
    .particle-portrait {
        min-height: 400px;
    }
}

.particle-portrait:active {
    cursor: grabbing;
}

/* Canvas fills container */
.particle-portrait canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Decorative frame corners */
.particle-portrait__frame {
    position: absolute;
    inset: -10px;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.5s ease;
}

.particle-portrait:hover .particle-portrait__frame {
    opacity: 0.9;
}

.particle-portrait__frame::before,
.particle-portrait__frame::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border: 2px solid var(--color-gold);
}

.particle-portrait__frame::before {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.particle-portrait__frame::after {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
}

/* Hint text */
.particle-portrait__hint {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.5s ease;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.particle-portrait__hint.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.particle-portrait__hint-icon {
    display: inline-flex;
    animation: rotateHint 3s ease-in-out infinite;
}

@keyframes rotateHint {
    0%, 100% {
        transform: rotate(-15deg);
    }
    50% {
        transform: rotate(15deg);
    }
}

/* Glow effect when assembled */
.particle-portrait::after {
    content: '';
    position: absolute;
    inset: -20%;
    background: radial-gradient(
        circle at center,
        rgba(255, 198, 47, 0.1) 0%,
        rgba(79, 38, 131, 0.1) 30%,
        transparent 60%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease;
}

.particle-portrait.is-assembled::after {
    opacity: 1;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .particle-portrait {
        margin: 0 auto;
    }

    .particle-portrait__hint {
        bottom: -35px;
        font-size: 10px;
    }

    /* More visible frame on mobile */
    .particle-portrait__frame {
        opacity: 0.7;
    }

    /* Larger frame corners for better visibility */
    .particle-portrait__frame::before,
    .particle-portrait__frame::after {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
}

/* Reduced motion - show static fallback */
@media (prefers-reduced-motion: reduce) {
    .particle-portrait {
        cursor: default;
    }

    .particle-portrait__hint {
        display: none;
    }

    .particle-portrait__hint-icon {
        animation: none;
    }
}
