/* ===== CHARACTER GRID ===== */

.characters-section {
    margin-top: 40px;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

/* Character Bubble */
.character-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.character-bubble:hover {
    transform: translateY(-8px);
}

/* Character Icon Circle */
.character-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #7dc0ff, #1b5fb0);
    box-shadow: 
        inset 0 0 15px rgba(255,255,255,0.4),
        0 0 20px rgba(100,170,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Hover glow effect */
.character-bubble:hover .character-icon {
    box-shadow: 
        inset 0 0 15px rgba(255,255,255,0.5),
        0 0 30px rgba(100,170,255,0.9),
        0 0 50px rgba(100,170,255,0.5);
}

.character-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Character Name Label */
.character-label {
    font-size: 14px;
    text-align: center;
    color: white;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    max-width: 120px;
}


/* ===== CHARACTER VIEWER POPUP ===== */

.character-viewer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.character-viewer.active {
    display: flex;
}

/* Backdrop */
.viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

/* Main Panel */
.viewer-panel {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    background: linear-gradient(135deg, #1e6fd1 0%, #1a56a8 100%);
    border-radius: 30px;
    box-shadow: 
        0 0 40px rgba(100,170,255,0.6),
        inset 0 0 30px rgba(255,255,255,0.1);
    padding: 40px;
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Close Button */
.viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease;
    line-height: 1;
}

.viewer-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

/* Content Layout */
.viewer-content {
    display: flex;
    gap: 40px;
    height: 100%;
}

/* Image Container */
.viewer-image-container {
    flex: 0 0 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-image-container img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

/* Info Panel */
.viewer-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;
}

#viewerName {
    font-size: 32px;
    letter-spacing: 2px;
    margin: 0;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Scrollable Bio */
.viewer-bio {
    flex: 1;
    overflow-y: auto;
    padding-right: 20px;
    font-size: 16px;
    line-height: 1.8;
    color: rgba(255,255,255,0.95);
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Custom Scrollbar */
.viewer-bio::-webkit-scrollbar {
    width: 8px;
}

.viewer-bio::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.viewer-bio::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
}

.viewer-bio::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .viewer-panel {
        padding: 30px 20px;
    }
    
    .viewer-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .viewer-image-container {
        flex: 0 0 auto;
    }
    
    .viewer-image-container img {
        max-height: 40vh;
    }
}