.modal-large {
    width: 90%;
    max-width: 800px;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    padding: 0 20px 20px 20px;
    overflow-y: auto;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}

.avatar-card {
    content-visibility: auto;
    contain-intrinsic-size: 120px 120px;
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--bg-base);
    border-radius: 8px;
    border: 2px solid var(--border-lighter);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s, border-color 0.2s;
    overflow: hidden;
}

.avatar-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.avatar-card:active {
    transform: translateY(0) scale(0.96);
}

.avatar-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.3); }
.avatar-card.rarity-uncommon.selected { border-color: var(--success); box-shadow: 0 0 0 3px rgba(var(--success-rgb), 0.3); }
.avatar-card.rarity-rare.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.3); }
.avatar-card.rarity-epic.selected { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(var(--purple-rgb), 0.3); }
.avatar-card.rarity-legendary.selected { border-color: var(--warning); box-shadow: 0 0 0 3px rgba(var(--warning-rgb), 0.3); }

.av-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.av-placeholder {
    font-size: 3rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

.avatar-card.locked .av-placeholder { filter: grayscale(1) brightness(0.4); }

.av-lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(var(--bg-base-rgb), 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    gap: 8px;
}

.av-lock-overlay span {
    font-size: 0.85rem;
    font-weight: 800;
    font-family: monospace;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(var(--bg-base-rgb), 0.8);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
}

.av-equipped-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--success);
    color: var(--text-on-accent);
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.avatar-selection-details {
    background: var(--bg-base);
    border-top: 1px solid var(--border-lighter);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.asd-info { display: flex; flex-direction: column; gap: 2px; }
.asd-name { font-size: 1.2rem; font-weight: 800; color: var(--text-pure); }
.asd-rarity { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }

.rarity-text-common { color: var(--text-dim); }
.rarity-text-uncommon { color: var(--success); }
.rarity-text-rare { color: var(--primary); }
.rarity-text-epic { color: var(--purple); }
.rarity-text-legendary { color: var(--warning); }

.avatar-letter-input {
    width: 65px; height: 65px; font-size: 2.5rem; text-align: center;
    text-transform: uppercase; font-weight: 900; background: var(--bg-input);
    border: 2px solid var(--border-lighter); border-radius: 16px;
    color: var(--text-pure); outline: none; transition: all 0.2s ease;
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.5);
}

.avatar-letter-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.4), inset 0 4px 10px rgba(0,0,0,0.5);
    background: rgba(var(--primary-rgb), 0.1);
}