/* =========================================
   PREMIUM MODAL REDESIGN
   ========================================= */

/* RESTORED: Tab Icons (Fixes Huge Icon Bug) */
.tab-icon-img {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.3));
    transition: 0.3s;
}

.category-tab:hover .tab-icon-img {
    transform: scale(1.1);
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.category-tab.active .tab-icon-img {
    filter: drop-shadow(0 0 8px #a855f7);
}

/* Modal Overlay */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(5, 7, 10, 0.85);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease-out;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Modal Content (The Card) */
/* Standard Modal Content (Rules, Info) */
.modal-content {
    background: #0f1219;
    border: 1px solid #1e2433;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    /* Wide for rules */
    margin: 5% auto;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 2rem;
    text-align: left;

    max-height: 85vh;
    /* Fix for overflow */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Prevent spill */
}

/* Ensure modal body scrolls */
.modal-body {
    overflow-y: auto;
    flex: 1;
    padding-right: 10px;
    /* Space for scrollbar */
}

/* Custom Scrollbar for Modal Body */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #1f2937;
    border-radius: 3px;
}

/* Standard Modal Header (Rules/Info) */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #fff;
}

/* Standard Close Button (span &times;) */
.close-modal {
    color: #9ca3af;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: 0.2s;
}

.close-modal:hover {
    color: #fff;
    transform: scale(1.1);
}

/* specialized Profile Modal Content */
.profile-modal-content {
    background: #0f1219;
    border: 1px solid #1e2433;
    border-radius: 24px;
    width: 90%;
    max-width: 480px;
    /* Narrow for profile */
    margin: 10% auto;
    /* Center vertically more */
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0;
    text-align: center;
    overflow: hidden;
}

@keyframes scaleUp {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Close Button */
.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: 0.2s;
    z-index: 10;
}

.close-modal-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Decoration */
.profile-decoration {
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
    filter: blur(40px);
    z-index: 0;
    pointer-events: none;
}

/* Profile Section */
.profile-section {
    position: relative;
    /* Ensure z-index works */
    padding: 40px 20px 20px;
    background: radial-gradient(circle at top, rgba(139, 92, 246, 0.15), transparent 70%);
    z-index: 1;
}

/* Avatar Ring */
.profile-avatar-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid #FCD34D;
    /* Gold Border as requested */
    box-shadow: 0 0 20px rgba(252, 211, 77, 0.3);
    object-fit: cover;
}

/* Player Name */
.profile-name {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(90deg, #c084fc, #a855f7);
    /* Purple Gradient */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

/* Main Rank Badge */
.main-rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(252, 211, 77, 0.1);
    /* Gold Tint */
    border: 1px solid rgba(252, 211, 77, 0.3);
    padding: 6px 16px;
    border-radius: 20px;
    color: #FCD34D;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.rank-icon-sm {
    width: 16px;
    height: 16px;
}

/* Region */
.profile-region {
    color: #4b5563;
    /* Dark Gray */
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
    /* Reduced margin */
}

/* Tagline (Interesting Word) */
.profile-tagline {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #fbbf24;
    /* Gold */
    font-weight: 800;
    opacity: 0.9;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

/* Button (NameMC) */
.namemc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1f2937;
    border: 1px solid #374151;
    color: #9ca3af;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: 0.2s;
    font-weight: 600;
}

.namemc-btn:hover {
    background: #374151;
    color: white;
}

/* Stats Container */
.stats-container {
    padding: 20px 30px 40px;
    text-align: left;
}

/* Position Section */
.section-label {
    color: #9ca3af;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.position-box {
    display: flex;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 25px;
}

.rank-number-box {
    background: linear-gradient(135deg, #FCD34D, #fbbf24);
    color: #000;
    font-weight: 800;
    font-size: 1.8rem;
    padding: 10px 20px;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(0 0, 100% 0, 85% 100%, 0% 100%);
    width: 80px;
}

.overall-stats {
    flex: 1;
    display: flex;
    align-items: center;
    padding-left: 10px;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    gap: 10px;
}

.trophy-icon {
    color: #fbbf24;
}

.points-muted {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 600;
}

/* Tiers Section */
.tiers-scroll-container {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    /* or no-wrap for scroll */
    justify-content: center;
    /* Center align items */
}

.tier-item-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.tier-circle-icon {
    width: 32px;
    height: 32px;
    /* background: #1f2937;  Optional background for icon */
    border-radius: 50%;
    padding: 4px;
    /* Space for ring */
    /* border: 2px solid #374151; */
}

.tier-rank-badge-sm {
    background: #854d0e;
    /* Gold Dark */
    color: #fef3c7;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.tier-rank-badge-sm.lt1,
.tier-rank-badge-sm.lt2 {
    background: #854d0e;
    color: #fbbf24;
}

.tier-rank-badge-sm.ht1,
.tier-rank-badge-sm.ht2 {
    background: #373add;
    color: #bfdbfe;
}

/* Blue for example */