/* Generic Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-close-btn-styled {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close-btn-styled:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.2);
}

/* Gacha Result Modal */
#gacha-result {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    color: white;
    cursor: pointer;
}

#gacha-result.active {
    display: flex;
}

.result-card {
    width: 250px;
    aspect-ratio: 2/3;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    animation: cardReveal 0.6s ease-out;
    box-shadow: 0 0 60px rgba(108, 92, 231, 0.5);
    transition: box-shadow 0.3s ease;
}

/* Rank Specific Glows for Result Card */
.result-card.rank-splus {
    box-shadow: 0 0 80px rgba(255, 215, 0, 0.6), 0 0 30px rgba(255, 255, 255, 0.8);
    animation: cardReveal 0.6s ease-out, rainbowGlow 3s infinite linear;
}

.result-card.rank-s {
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.6);
    animation: cardReveal 0.6s ease-out, pulseGold 2s infinite ease-in-out;
}

.result-card.rank-a {
    box-shadow: 0 0 50px rgba(255, 69, 58, 0.6);
}

.result-card.rank-b {
    box-shadow: 0 0 40px rgba(162, 155, 254, 0.6);
}

.result-card.rank-c {
    box-shadow: 0 0 30px rgba(128, 128, 128, 0.5);
}

.result-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.result-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    text-align: center;
}

/* Card Profile Modal */
.card-profile-modal {
    background: #1a1a2e;
    padding: 0;
    overflow: hidden;
    max-width: 400px;
    width: 90%;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.profile-art-container {
    width: 100%;
    aspect-ratio: 2/3;
    background: #000;
    position: relative;
}

.profile-art {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.profile-info-container {
    padding: 20px;
    background: #1a1a2e;
    color: white;
    display: flex;
    flex-direction: column;
}

.profile-main-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
}

.profile-left-col {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.profile-right-col {
    text-align: right;
    padding-left: 20px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.profile-rank {
    font-size: 24px;
    font-weight: 800;
}

.profile-name {
    font-size: 20px;
    margin: 0;
    line-height: 1.2;
}

.profile-collection {
    color: var(--text-muted);
    font-size: 14px;
    text-align: left;
}

.stat-box {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: white;
    line-height: 1;
}