/* mastery-card.css */

/* Define mastery card mask (using dedicated SVG mask) */
:root {
    /* Uses alpha channel; white = visible, transparent = hidden */
    --mastery-card-mask: url('/assets/img/frames/s2526/mastery-player-mask.svg');
}

/* Mastery Card Container */
.mastery-card {
    position: relative;
    width: 100%;
    aspect-ratio: 824 / 982; /* 824x982 aspect ratio - matches PNG dimensions */
    overflow: hidden;
}

/* Layer 1: Tier Background PNG (furthest back) */
.mastery-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--mastery-tier-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

/* Layer 2: Player Image Container */
.mastery-player-image-container {
    position: absolute;
    top: 0px;
    left: 0px;
    right: 0px;
    bottom: 0px;
    z-index: 2;
    overflow: hidden;
    /* Use the dedicated SVG mask for player image clipping */
    -webkit-mask-image: var(--mastery-card-mask);
    mask-image: var(--mastery-card-mask);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.mastery-player-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
}

/* Layer 3: Tier Frame PNG */
.mastery-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--mastery-tier-frame);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 3;
    pointer-events: none;
}

/* Layer 4: UI Elements */
.mastery-ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
}

/* Rating */
.mastery-rating {
    position: absolute;
    top: 3%;
    left: 5%;
    color: #ffffff;
    font-family: var(--wp--preset--font-family--oswald, 'Oswald', sans-serif);
    font-size: clamp(2.5rem, 4vw, 4rem);
    font-weight: 600;
    line-height: 1;
}

/* Position */
.mastery-position {
    position: absolute;
    top: 22%;
    left: 6%;
    color: #ffffff;
    font-family: var(--wp--preset--font-family--big-shoulders-display, 'Big Shoulders Display', sans-serif);
    font-size: clamp(1.6rem, 2.8vw, 2.6rem);
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1;
}

/* Player Name */
.mastery-name {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    color: #ffffff;
    font-family: var(--wp--preset--font-family--big-shoulders-display, 'Big Shoulders Display', sans-serif);
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1.1;
    word-wrap: break-word;
}

/* Bottom Icons Row: Playstyle - Nation - League */
.mastery-bottom-icons {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.mastery-bottom-icon {
    width: 23px;
    height: 23px;
    border-radius: 4px;
}

/* Skill Icons (Left Side - Tier 2+ only) */
.mastery-skill-icons {
    position: absolute;
    left: 3%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.mastery-card.tier-0 .mastery-skill-icons,
.mastery-card.tier-1 .mastery-skill-icons {
    display: none;
}

.mastery-skill-icon {
    width: clamp(20px, 4vw, 32px);
    height: clamp(20px, 4vw, 32px);
    filter: drop-shadow(1px 1px 3px rgba(0, 0, 0, 0.7));
    border-radius: 2px;
}

/* Skills Container (removed - replaced with skill icons) */

/* Tier-specific styling - CSS variables will be set dynamically via PHP from uploaded images */

/* Responsive adjustments */
@media (max-width: 768px) {
    .mastery-card {
        max-width: 300px;
        margin: 0 auto;
    }
    
    /* Keep mobile/tablet aligned with desktop positioning */
    .mastery-rating {
        top: 3%;
        font-size: 3em;
        left: 5%;
    }
    
    .mastery-position {
        top: 23%;
        font-size: 2em;
        left: 6%;
    }
    
    .mastery-bottom-icons {
        bottom: 4%;
        gap: 10px;
    }
    
    .mastery-skill-icons {
        left: 2%;
        gap: 6px;
    }
    
    .mastery-name {
        bottom: 11%;
        font-size: 1.8em;
        width: 92%;
    }
    
    .mastery-bottom-icons {
        bottom: 6%;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .mastery-card {
        max-width: 250px;
    }
    
    .mastery-bottom-icons {
        gap: 6px;
    }
}

/* Other Versions Section Styling */
.m-other-versions {
    margin: 20px 0;
}

.m-other-versions-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.m-other-versions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.m-version-link {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background-color: #666;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

/* Tier-specific styling with background colors */
.m-version-base {
    background-color: #445E52;
}

.m-version-base:hover {
    background-color: #3a5047;
}

.m-version-tier1 {
    background-color: #666;
}

.m-version-tier1:hover {
    background-color: #555;
}

.m-version-mastery2 {
    background-color: #7C6AAF;
}

.m-version-mastery2:hover {
    background-color: #6d5a96;
}

.m-version-promo:hover {
    filter: brightness(0.9);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .m-other-versions-list {
        gap: 6px;
    }
    
    .m-version-link {
        padding: 6px 10px;
        font-size: 13px;
    }
}