/* ================================================
   CHARACTER SELECTOR - RETRO SNES STYLE
   This file is loaded AFTER modals-retro.css, so styles here take priority
   ================================================ */

#characterSelector {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    justify-content: center;
    z-index: 100;
}

/* Note: Button styles moved to buttons-retro.css */

#characterModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 20px 10px;
}

/* Note: .modal-content styles are in modals-retro.css */

/* ================================================
   CHARACTER GRID WITH RETRO SCROLLBAR
   ================================================ */
#characterGrid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px;
    padding-right: 8px; /* Space for scrollbar */
    
    /* Limit to 3 rows visible, then scroll */
    max-height: calc((100px + 16px + 16px + 4px) * 3 + 12px * 2 + 24px);
    overflow-y: scroll; /* Always show scrollbar! */
    overflow-x: hidden;
    
    /* Retro inset border */
    background: #2a3a5a;
    box-shadow: 
        inset 3px 3px 0 #1a2a4a,
        inset -3px -3px 0 #3a4a6a;
    
    /* Firefox scrollbar */
    scrollbar-width: auto;
    scrollbar-color: #4a5a7a #1a2a4a;
}

/* ================================================
   WEBKIT SCROLLBAR (Chrome, Safari, Edge) - CHUNKY SNES STYLE
   ================================================ */
#characterGrid::-webkit-scrollbar {
    width: 20px; /* Chunky retro scrollbar */
}

#characterGrid::-webkit-scrollbar-track {
    background: #1a2a4a; /* Dark inset background */
    border: 3px solid #2a3a5a;
    border-radius: 0;
    
    /* Inset shadow effect */
    box-shadow: 
        inset 2px 2px 0 #0a1a3a,
        inset -2px -2px 0 #3a4a6a;
}

#characterGrid::-webkit-scrollbar-thumb {
    background: #4a5a7a;
    border: none;
    border-radius: 0; /* Square edges! */
    
    /* Chunky 3D button effect */
    box-shadow: 
        inset -2px -2px 0 #2a3a5a,    /* Bottom-right shadow */
        inset 2px 2px 0 #6a7a9a,      /* Top-left highlight */
        inset -4px -4px 0 #1a2a4a,    /* Inner bottom shadow */
        inset 4px 4px 0 #7a89a8;      /* Inner top highlight */
}

#characterGrid::-webkit-scrollbar-thumb:hover {
    background: #5a6a8a;
    box-shadow: 
        inset -2px -2px 0 #3a4a6a,
        inset 2px 2px 0 #7a8aaa,
        inset -4px -4px 0 #2a3a5a,
        inset 4px 4px 0 #8a99b8;
}

#characterGrid::-webkit-scrollbar-thumb:active {
    background: #3a4a6a; /* Darker when pressed */
    box-shadow: 
        inset 2px 2px 0 #1a2a4a,
        inset -2px -2px 0 #4a5a7a;
}

/* Scrollbar arrow buttons */
#characterGrid::-webkit-scrollbar-button {
    background: #4a5a7a;
    height: 20px;
    border: none;
    border-radius: 0;
    box-shadow: 
        inset -2px -2px 0 #2a3a5a,
        inset 2px 2px 0 #6a7a9a;
}

#characterGrid::-webkit-scrollbar-button:hover {
    background: #5a6a8a;
    box-shadow: 
        inset -2px -2px 0 #3a4a6a,
        inset 2px 2px 0 #7a8aaa;
}

#characterGrid::-webkit-scrollbar-button:active {
    background: #3a4a6a;
    box-shadow: 
        inset 2px 2px 0 #1a2a4a,
        inset -2px -2px 0 #4a5a7a;
}

/* ================================================
   CHARACTER OPTIONS (boxes in grid)
   Note: Main styles are in modals-retro.css
   ================================================ */

.character-option {
    /* Styles defined in modals-retro.css */
}

.character-preview {
    width: 100px;
    height: 100px;
    margin: 0 auto 10px;
    position: relative;
    border: 2px solid #1a2a4a;
    background: #1a1a2e;
}

.character-name {
    color: #ffffff;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    text-transform: lowercase;
    font-weight: normal;
}

.character-option.selected .character-name {
    color: #000000;
}

/* ================================================
   CHARACTER STATS DISPLAY
   ================================================ */
.character-stats {
    margin-top: 8px;
    padding: 6px 4px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    font-size: 8px;
    line-height: 1.4;
}

.character-option.selected .character-stats {
    background: rgba(0, 0, 0, 0.5);
}

.character-stats .stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}

.character-stats .stat-row:last-of-type {
    margin-bottom: 4px;
}

.character-stats .stat-label {
    color: #ffe66d;
    font-family: 'Press Start 2P', monospace;
    font-size: 7px;
}

.character-option.selected .character-stats .stat-label {
    color: #ffd700;
}

.character-stats .stat-stars {
    color: #4ecdc4;
    font-family: monospace;
    font-size: 9px;
    letter-spacing: 1px;
}

.character-option.selected .character-stats .stat-stars {
    color: #00ff88;
}

/* Note: Close button styles are in buttons-retro.css */

/* ================================================
   MOBILE RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
    #characterGrid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 10px;
        padding-right: 6px;
        
        /* Adjust height for 3-column layout */
        max-height: calc((60px + 15px + 15px + 4px) * 3 + 10px * 2 + 20px);
    }
    
    .character-preview {
        width: 60px;
        height: 60px;
    }
    
    .character-name {
        font-size: 8px;
    }
    
    /* Scrollbar slightly smaller on mobile */
    #characterGrid::-webkit-scrollbar {
        width: 16px;
    }
}

@media (max-width: 480px) {
    #characterGrid {
        grid-template-columns: repeat(2, 1fr);
        
        /* Adjust height for 2-column layout */
        max-height: calc((60px + 15px + 15px + 4px) * 3 + 10px * 2 + 20px);
    }
    
    .character-name {
        font-size: 7px;
    }
}

/* ================================================
   DESIGN NOTES
   ================================================ */
/*
   This file overrides any conflicting styles from modals-retro.css
   since it's loaded AFTER in the HTML.
   
   Scrollbar Style:
   - Always visible (overflow-y: scroll)
   - Chunky 20px width
   - SNES-style 3D beveled effect
   - Inset track with shadows
   - Square corners (no border-radius)
   
   Grid Container:
   - Shows 3 rows of characters
   - Dark inset border (#2a3a5a)
   - Padding prevents overlap with scrollbar
   - Responsive: 5 cols → 3 cols → 2 cols
*/
