/* Skin Selector Styles */

/* Skin button on character card */
.char-card-skin-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #6aaa64;
    border-radius: 6px;
    padding: 6px 12px;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: #6aaa64;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 5;
    touch-action: manipulation; /* Optimize for touch */
    -webkit-tap-highlight-color: rgba(106, 170, 100, 0.3); /* Visual feedback on touch */
}

.char-card-skin-btn:hover {
    background: rgba(106, 170, 100, 0.2);
    border-color: #7bc96f;
    color: #7bc96f;
}

.char-card-skin-btn:active {
    transform: scale(0.95);
}

/* Skin selector modal */
.skin-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.skin-selector-modal.hidden {
    display: none;
}

.skin-selector-content {
    background: #1a1a1a;
    border: 3px solid #444;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.skin-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.skin-selector-header h2 {
    font-family: 'Press Start 2P', monospace;
    font-size: 18px;
    color: #fff;
    margin: 0;
}

.skin-selector-close {
    background: none;
    border: none;
    color: #999;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.skin-selector-close:hover {
    color: #fff;
}

/* Skin grid */
.skin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.skin-item {
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.skin-item:hover:not(.skin-locked) {
    border-color: #6aaa64;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(106, 170, 100, 0.3);
}

.skin-item.skin-equipped {
    border-color: #6aaa64;
    background: linear-gradient(135deg, #2a2a2a 0%, #1e3a1e 100%);
}

.skin-item.skin-equipped::after {
    content: "✓ EQUIPPED";
    position: absolute;
    top: 5px;
    right: 5px;
    background: #6aaa64;
    color: #fff;
    font-size: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Press Start 2P', monospace;
}

.skin-item.skin-locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.skin-item.skin-locked::before {
    content: "🔒";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

/* Skin preview - mini player sprite */
.skin-preview {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    background: #1a1a1a;
    border-radius: 6px;
    position: relative;
}

/* Skin preview sprites moved to individual character CSS files */
/* See: styles/characters/hero.css, knight.css, ranger.css, mage.css, champion.css */

.skin-info {
    text-align: center;
}

.skin-name {
    font-family: 'Press Start 2P', monospace;
    font-size: 13px;
    color: #fff;
    margin: 0 0 8px 0;
}

.skin-rarity {
    font-size: 10px;
    color: #888;
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

.skin-rarity.common { color: #999; }
.skin-rarity.rare { color: #4a9eff; }
.skin-rarity.epic { color: #a335ee; }
.skin-rarity.legendary { color: #ff8000; }

.skin-unlock-req {
    font-size: 9px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .skin-selector-content {
        padding: 20px;
        max-height: 90vh;
    }

    .skin-selector-header h2 {
        font-size: 14px;
    }

    .skin-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .char-card-skin-btn {
        font-size: 8px;
        padding: 4px 8px;
    }
}
