/* ========================================
   9. Player Profile Styles - Retro Identity
   ======================================== */

.retro-player-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 80vh;
    padding: 100px 20px 60px;
    position: relative;
    z-index: 10;
}

.retro-player-container {
    width: 100%;
    max-width: 1100px;
    background: rgba(24, 7, 7, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(240, 103, 6, 0.3);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    overflow: visible;
    position: relative;
    z-index: 10;
}

/* Header Section */
.retro-player-header {
    padding: 40px;
    background: linear-gradient(180deg, rgba(240, 103, 6, 0.15) 0%, rgba(24, 7, 7, 0) 100%);
    border-bottom: 1px solid rgba(240, 103, 6, 0.15);
    display: flex;
    align-items: center;
    gap: 30px;
}

.player-avatar-main {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid #f06706;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px;
    box-shadow: 0 0 20px rgba(240, 103, 6, 0.2);
}

.player-avatar-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player-title-group h1 {
    font-family: 'Raritas', sans-serif;
    font-size: 42px;
    color: #fff0d4;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(240, 103, 6, 0.3);
}

.player-nickname {
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    color: #f06706;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

/* Content Grid */
.retro-player-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
    padding: 40px;
}

@media (max-width: 991px) {
    .retro-player-content {
        grid-template-columns: 1fr;
    }
}

/* Character Card */
.player-info-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 24px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: rgba(255, 255, 255, 0.4);
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 600;
}

.info-value {
    color: #fff;
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    font-weight: 700;
}

/* Equipment Grid */
.armoury-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.item-slot {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-slot:hover {
    border-color: #f06706;
    background: rgba(240, 103, 6, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.item-image {
    width: 48px;
    height: 48px;
    background-size: cover;
    background-position: center;
}

/* Special Items (SOX) - Magical Star Border */
.item-slot.special {
    background: rgba(240, 103, 6, 0.05);
    border: 1.5px solid rgba(240, 103, 6, 0.6);
    position: relative;
    z-index: 10;
    overflow: visible !important; /* CRITICAL: Must be visible for tooltips to show */
}

/* Orbiting & Twinkling Star Effect */
.item-slot.special::before,
.item-slot.special::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    z-index: 10;
    clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%); /* 4-pointed star */
    box-shadow: 0 0 10px #fff;
    animation: star-orbit-twinkle 4s linear infinite;
    pointer-events: none;
}

.item-slot.special::after {
    animation-delay: -2s; /* Start halfway through for two opposing stars */
    width: 8px;
    height: 8px;
}

@keyframes star-orbit-twinkle {
    0% { top: -5px; left: -5px; background: #fff; opacity: 1; transform: scale(1); }
    12.5% { opacity: 0; transform: scale(0.5); }
    25% { top: -5px; left: calc(100% - 5px); background: #cadfff; opacity: 1; transform: scale(1); }
    37.5% { opacity: 0; transform: scale(0.5); }
    50% { top: calc(100% - 5px); left: calc(100% - 5px); background: #fff4ea; opacity: 1; transform: scale(1); }
    62.5% { opacity: 0; transform: scale(0.5); }
    75% { top: calc(100% - 5px); left: -5px; background: #ffccaa; opacity: 1; transform: scale(1); }
    87.5% { opacity: 0; transform: scale(0.5); }
    100% { top: -5px; left: -5px; background: #fff; opacity: 1; transform: scale(1); }
}

/* Internal shimmer on the image */
.item-slot.special .item-image {
    position: relative;
    z-index: 5;
}

.item-slot.special .item-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        transparent 40%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 60%
    );
    background-size: 250% 250%;
    animation: shimmer-swipe 3s infinite linear;
    pointer-events: none;
}

/* Tooltip Logic (CSS Only - Compact and Sideways) */
.item-tooltip {
    position: absolute;
    top: 50%;
    left: 110%;
    transform: translateY(-50%) translateX(-10px);
    width: 280px; /* Reduced width to prevent off-screen but still wider than default */
    max-height: none;
    height: auto;
    overflow: visible;
    background: #050101 !important;
    border: 1px solid rgba(240, 103, 6, 1);
    border-radius: 6px;
    padding: 8px 12px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 2147483647;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 1);
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    line-height: 0.9 !important;
    color: #fff;
    text-align: left !important;
    white-space: normal; /* Collapse spaces that cause indentation */
    text-shadow: 0 1px 1px rgba(0,0,0,0.8);
}

/* Aggressive Reset for any nested elements */
.item-tooltip, .item-tooltip * {
    text-align: left !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* Force block-style for common tags but keep them tight */
.item-tooltip div, .item-tooltip p, .item-tooltip span {
    display: inline-block; /* Inline-block allows for better wrapping than block in some contexts */
    width: 100%;
}

/* Style for cleaner scrolling if needed */
.item-tooltip::-webkit-scrollbar {
    width: 3px;
}
.item-tooltip::-webkit-scrollbar-thumb {
    background: #f06706;
}

/* Tooltip Arrow (Left) */
.item-tooltip::after {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: transparent rgba(240, 103, 6, 0.9) transparent transparent;
}

/* Position on the left for items in the last two columns to prevent screen overflow */
.item-slot:nth-child(4n) .item-tooltip,
.item-slot:nth-child(3n) .item-tooltip {
    left: auto;
    right: 120%;
    transform: translateY(-50%) translateX(15px);
}

.item-slot:nth-child(4n) .item-tooltip::after,
.item-slot:nth-child(3n) .item-tooltip::after {
    right: auto;
    left: 100%;
    border-color: transparent transparent transparent rgba(240, 103, 6, 0.9);
}

.item-slot:hover {
    z-index: 100000;
}

.item-slot:hover .item-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Ensure all parent containers allow the tooltip to overflow */
.retro-player-container, 
.retro-player-content,
.player-column-right, 
.armoury-grid {
    overflow: visible !important;
}

.section-title-retro {
    font-family: 'Raritas', sans-serif;
    font-size: 20px;
    color: #f06706;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title-retro::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(240, 103, 6, 0.3), transparent);
}
