/* Import Hollow Realms CSS Variables */
:root {
    --col-backgr: #0F1116;
    --col-backgr2: #1A1D23;
    --col-secondary: #EECC96;
    --col-button: #C7815C;
    --col-button-txt: #000000;
    --col-tertiary: #E42C2C;
    --col-txt: #ffffff;
    --col-headline: #ffffff;
    --col-red: #B23131;
    --col-brown: #8E7551;
    --col-blue: #2A4DA7;
    --col-yellow: #F6BE2C;
    --col-orange: #F2683A;
    --col-purple: #8C1AE5;
    --col-darkred: #89233E;
    --col-gray: #2D2D2D;
}

/* Disable body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    left: 0;
}

/* Main Leaderboard Container */
.leaderboard-container {
    max-width: 1400px;
    width: 90%;
    margin: 0 auto;
    padding: 40px 20px;
    background: transparent;
}

/* Search Section */
.search-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    gap: 15px;
}

.search-section input {
    padding: 15px 25px;
    border: 2px solid var(--col-gray);
    background: var(--col-backgr2);
    color: var(--col-txt);
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Grenze', serif;
    font-weight: 500;
    width: 300px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.search-section input:focus {
    border-color: var(--col-secondary);
    background: var(--col-backgr);
}

.search-section input::placeholder {
    color: #888;
    font-style: italic;
}

.search-section button {
    padding: 6px 25px !important;
    color: var(--col-txt);
    border-radius: 8px;
    font-size: 16px !important;;
    font-family: 'Grenze', serif;
    font-weight: 600;
    text-transform: uppercase;
}

/* Search Suggestions */
.search-container {
    position: relative;
    display: inline-block;
    width: 350px;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--col-backgr2);
    border: 2px solid var(--col-gray);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.search-suggestions.show {
    display: block;
    animation: suggestionsFadeIn 0.2s ease;
}

@keyframes suggestionsFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.suggestion-item {
    padding: 12px 20px;
    color: var(--col-txt);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(45, 45, 45, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: rgba(238, 204, 150, 0.1);
    color: var(--col-secondary);
}

.suggestion-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid var(--col-gray);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.suggestion-name {
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Grenze', serif;
}

/* Filter Section */
.filter-section {
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
}

.filter-tabs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--col-backgr2);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--col-gray);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.filter-btn {
    padding: 12px 24px;
    background: var(--col-backgr);
    color: var(--col-txt);
    border: 2px solid var(--col-gray);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Grenze', serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.1s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.filter-btn:hover {
    border-color: var(--col-secondary);
    color: var(--col-secondary);
    transform: translateY(-1px);
}

/* Race-specific filter colors */
.filter-btn[data-filter="demon"].active {
    background: linear-gradient(135deg, #FF265C, #D91E50);
    border-color: #FF265C;
    color: white;
}

.filter-btn[data-filter="elve"].active {
    background: linear-gradient(135deg, #90D1EE, #7BC5E8);
    border-color: #90D1EE;
    color: black;
}

.filter-btn[data-filter="dragonkin"].active {
    background: linear-gradient(135deg, #D6935C, #C2834F);
    border-color: #D6935C;
    color: black;
}

/* Race-specific filter hover effects - must come after general hover */
.filter-btn[data-filter="demon"]:hover:not(.active) {
    border-color: #FF265C !important;
    color: #FF265C !important;
}

.filter-btn[data-filter="elve"]:hover:not(.active) {
    border-color: #90D1EE !important;
    color: #90D1EE !important;
}

.filter-btn[data-filter="dragonkin"]:hover:not(.active) {
    border-color: #D6935C !important;
    color: #D6935C !important;
}
.filter-btn.active {
    background: linear-gradient(135deg, var(--col-secondary), var(--col-yellow));
    color: var(--col-button-txt);
    border-color: var(--col-secondary);
}

/* Class Dropdown */
.class-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle span {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.class-dropdown.active .dropdown-toggle span {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    background: var(--col-backgr2);
    min-width: 250px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 1000;
    border-radius: 12px;
    padding: 10px 0;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    border: 2px solid var(--col-gray);
    backdrop-filter: blur(10px);
}

.class-dropdown.active .dropdown-content {
    display: block;
    animation: dropdownFadeIn 0.3s ease;
}

.dropdown-content a {
    color: var(--col-txt);
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    font-weight: 500;
    font-family: 'Grenze', serif;
    position: relative;
}

.dropdown-content a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--col-secondary), var(--col-button));
    transition: width 0.3s ease;
}

.dropdown-content a:hover::before {
    width: 4px;
}

.dropdown-content a:hover {
    background: rgba(238, 204, 150, 0.1);
    color: var(--col-secondary);
    padding-left: 24px;
}

@keyframes dropdownFadeIn {
    from { 
        opacity: 0; 
        transform: translateX(-50%) translateY(-10px); 
        filter: blur(2px);
    }
    to { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0); 
        filter: blur(0);
    }
}

/* Enhanced Leaderboard */
.leaderboard {
    background: linear-gradient(135deg, var(--col-backgr2), var(--col-backgr));
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    border: 1px solid var(--col-gray);
    position: relative;
}

.leaderboard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--col-red), var(--col-orange), var(--col-yellow), var(--col-secondary));
    border-radius: 16px 16px 0 0;
}

.leaderboard h3 {
    text-align: center;
    color: var(--col-headline);
    font-size: 2.8rem;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    font-family: 'Grenze', serif;
    font-weight: 700;
    position: relative;
}

.leaderboard h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--col-secondary), var(--col-button));
    border-radius: 2px;
}

/* Leaderboard Table Layout */
#leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-item {
    background: linear-gradient(135deg, rgba(26, 29, 35, 0.8), rgba(45, 45, 45, 0.6));
    margin: 0;
    padding: 20px 25px;
    border-radius: 12px;
    display: grid;
    grid-template-columns: 80px 60px 1fr auto auto;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.leaderboard-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(238, 204, 150, 0.05), transparent);
    transition: left 0.8s ease;
}

.leaderboard-item:hover::before {
    left: 100%;
}

.leaderboard-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
    border-color: var(--col-secondary);
    background: linear-gradient(135deg, rgba(26, 29, 35, 0.9), rgba(45, 45, 45, 0.8));
}

/* Top 3 special styling */
.leaderboard-item:nth-child(1) {
    border-left: 4px solid #FFD700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(26, 29, 35, 0.8));
}

.leaderboard-item:nth-child(1):hover {
    border-color: #FFD700;
    box-shadow: 0 12px 30px rgba(255, 215, 0, 0.3);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(26, 29, 35, 0.9));
}

.leaderboard-item:nth-child(1):hover::before {
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.15), transparent);
}

.leaderboard-item:nth-child(2) {
    border-left: 4px solid #C0C0C0;
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.1), rgba(26, 29, 35, 0.8));
}

.leaderboard-item:nth-child(2):hover {
    border-color: #C0C0C0;
    box-shadow: 0 12px 30px rgba(192, 192, 192, 0.3);
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(26, 29, 35, 0.9));
}

.leaderboard-item:nth-child(2):hover::before {
    background: linear-gradient(90deg, transparent, rgba(192, 192, 192, 0.15), transparent);
}

.leaderboard-item:nth-child(3) {
    border-left: 4px solid #CD7F32;
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.1), rgba(26, 29, 35, 0.8));
}

.leaderboard-item:nth-child(3):hover {
    border-color: #CD7F32;
    box-shadow: 0 12px 30px rgba(205, 127, 50, 0.3);
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(26, 29, 35, 0.9));
}

.leaderboard-item:nth-child(3):hover::before {
    background: linear-gradient(90deg, transparent, rgba(205, 127, 50, 0.15), transparent);
}

/* Rank styling */
.rank {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    font-family: 'Grenze', serif;
    color: var(--col-secondary);
    transition: all 0.3s ease;
}

.rank.first { 
    color: #FFD700;
    font-size: 2.2rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.leaderboard-item:nth-child(1):hover .rank.first {
    color: #FFD700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 25px rgba(255, 215, 0, 0.4);
    transform: scale(1.1);
}

.rank.second { 
    color: #C0C0C0;
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(192, 192, 192, 0.5);
}

.leaderboard-item:nth-child(2):hover .rank.second {
    color: #C0C0C0;
    text-shadow: 0 0 15px rgba(192, 192, 192, 0.8), 0 0 25px rgba(192, 192, 192, 0.4);
    transform: scale(1.1);
}

.rank.third { 
    color: #CD7F32;
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(205, 127, 50, 0.5);
}

.leaderboard-item:nth-child(3):hover .rank.third {
    color: #CD7F32;
    text-shadow: 0 0 15px rgba(205, 127, 50, 0.8), 0 0 25px rgba(205, 127, 50, 0.4);
    transform: scale(1.1);
}

/* Player avatar */
.player-avatar {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    border: 3px solid var(--col-gray);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
}

.leaderboard-item:hover .player-avatar {
    border-color: var(--col-secondary);
    box-shadow: 0 6px 16px rgba(238, 204, 150, 0.3);
    transform: scale(1.05);
}

/* Top 3 avatar special hover effects */
.leaderboard-item:nth-child(1):hover .player-avatar {
    border-color: #FFD700;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4), 0 0 15px rgba(255, 215, 0, 0.3);
    transform: scale(1.08);
}

.leaderboard-item:nth-child(2):hover .player-avatar {
    border-color: #C0C0C0;
    box-shadow: 0 6px 20px rgba(192, 192, 192, 0.4), 0 0 15px rgba(192, 192, 192, 0.3);
    transform: scale(1.08);
}

.leaderboard-item:nth-child(3):hover .player-avatar {
    border-color: #CD7F32;
    box-shadow: 0 6px 20px rgba(205, 127, 50, 0.4), 0 0 15px rgba(205, 127, 50, 0.3);
    transform: scale(1.08);
}

/* Player info */
.player-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.player-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--col-headline);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    font-family: 'Grenze', serif;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-class {
    font-size: 0.95rem;
    color: var(--col-secondary);
    font-style: italic;
    font-weight: 500;
    opacity: 0.9;
}

.player-nation {
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: 16px;
    display: inline-block;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Nation colors matching the races */
.nation-demon { 
    background: linear-gradient(135deg, #FF265C, #D91E50);
    color: white;
}
.nation-elve { 
    background: linear-gradient(135deg, #90D1EE, #7BC5E8);
    color: black;
}

.nation-dragonkin { 
    background: linear-gradient(135deg, #D6935C, #C2834F);
    color: black;
}
.nation-unknown {
    background: linear-gradient(135deg, var(--col-gray), #444);
    color: white;
}

/* Level badge */
.player-level {
    background: var(--col-gray);
    color: var(--col-txt);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    min-width: 60px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

/* Points */
.player-points {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--col-yellow);
    text-align: right;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    font-family: 'Grenze', serif;
    min-width: 120px;
    transition: all 0.3s ease;
}

/* Top 3 points special hover effects */
.leaderboard-item:nth-child(1):hover .player-points {
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6), 1px 1px 2px rgba(0,0,0,0.7);
    transform: scale(1.05);
}

.leaderboard-item:nth-child(2):hover .player-points {
    color: #C0C0C0;
    text-shadow: 0 0 10px rgba(192, 192, 192, 0.6), 1px 1px 2px rgba(0,0,0,0.7);
    transform: scale(1.05);
}

.leaderboard-item:nth-child(3):hover .player-points {
    color: #CD7F32;
    text-shadow: 0 0 10px rgba(205, 127, 50, 0.6), 1px 1px 2px rgba(0,0,0,0.7);
    transform: scale(1.05);
}

/* Loading animation */
.loading {
    text-align: center;
    color: var(--col-txt);
    font-size: 1.3rem;
    padding: 40px;
    display: none;
    font-family: 'Grenze', serif;
}

.loading.show {
    display: block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Modal Styles */


/* Error Modal Styles */
.error-modal-content {
    text-align: center;
    color: var(--col-txt);
    font-family: 'Grenze', serif;
}

.error-modal-compact {
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.error-modal-compact .error-icon {
    font-size: 2.8rem;
    margin-bottom: 18px;
    opacity: 0.9;
    color: var(--col-secondary);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.error-modal-compact p {
    font-size: 1.1rem;
    line-height: 1.5;
    color: var(--col-txt);
    margin: 0 0 25px 0;
    font-weight: 400;
    letter-spacing: 0.3px;
    max-width: 280px;
    word-wrap: break-word;
}

.error-modal-compact .error-ok-btn {
    background: linear-gradient(135deg, var(--col-orange), var(--col-yellow));
    color: var(--col-backgr);
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Grenze', serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.error-modal-compact .error-ok-btn:hover {
    background: linear-gradient(135deg, var(--col-yellow), var(--col-orange));
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

/* Player Profile in Modal */
.player-profile {
    color: var(--col-txt);
    text-align: center;
    font-family: 'Grenze', serif;
}

.player-profile h2 {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--col-secondary);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    font-weight: 700;
}

.player-rank {
    font-size: 1.3rem;
    color: var(--col-yellow);
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.profile-card {
    background: linear-gradient(135deg, rgba(26, 29, 35, 0.9), rgba(45, 45, 45, 0.7));
    border-radius: 16px;
    padding: 25px;
    border: 2px solid var(--col-gray);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--col-secondary), var(--col-button));
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    border-color: var(--col-secondary);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.profile-rank {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--col-yellow);
}

.profile-class {
    font-size: 1.2rem;
    color: var(--col-headline);
    font-weight: 600;
}

.profile-points {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--col-secondary);
    text-align: center;
    margin: 15px 0;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    font-size: 0.9rem;
    color: var(--col-txt);
}

.profile-stats div {
    padding: 8px;
    background: rgba(45, 45, 45, 0.5);
    border-radius: 6px;
    text-align: center;
}

/* New Modal Profile Styles - Matching Screenshot Design */
.player-profile-new {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--col-txt);
    font-family: 'Grenze', serif;
    padding: 20px;
}

.profile-header-new {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.profile-avatar-large {
    width: 120px !important;
    height: 120px !important;
    border-radius: 50%;
    border: 4px solid var(--col-secondary);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    margin-bottom: 15px;
}

.profile-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--col-headline);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    margin: 0;
    text-align: center;
}

.profile-nation {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.profile-position {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 15px 25px;
    background: linear-gradient(135deg, rgba(45, 45, 45, 0.6), rgba(26, 29, 35, 0.8));
    border-radius: 50px;
    border: 3px solid var(--col-gray);
    min-width: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), inset 0 1px 3px rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

/* Top 3 positions get special treatment */
.profile-position.top-3 {
    background: linear-gradient(135deg, rgba(246, 190, 44, 0.1), rgba(26, 29, 35, 0.8));
    border: 3px solid var(--col-yellow);
    box-shadow: 0 8px 24px rgba(246, 190, 44, 0.2), inset 0 1px 3px rgba(255, 255, 255, 0.1);
}

.profile-position.top-3::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(246, 190, 44, 0.1), transparent);
    animation: shimmer 3s infinite;
}

/* Second place - Silver */
.profile-position.rank-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.1), rgba(26, 29, 35, 0.8));
    border: 3px solid #C0C0C0;
    box-shadow: 0 8px 24px rgba(192, 192, 192, 0.2), inset 0 1px 3px rgba(255, 255, 255, 0.1);
}

.profile-position.rank-2::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(192, 192, 192, 0.1), transparent);
    animation: shimmer 3s infinite;
}

/* Third place - Bronze */
.profile-position.rank-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.1), rgba(26, 29, 35, 0.8));
    border: 3px solid #CD7F32;
    box-shadow: 0 8px 24px rgba(205, 127, 50, 0.2), inset 0 1px 3px rgba(255, 255, 255, 0.1);
}

.profile-position.rank-3::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(205, 127, 50, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.position-label {
    display: none;
}

.position-value {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 13px;
}

.position-main-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.position-text-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding-right: 15px;
}

.position-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--col-secondary);
    text-shadow: 0 0 10px rgba(238, 204, 150, 0.3);
    line-height: 1;
}

/* Gold - 1st place */
.profile-position.top-3 .position-number {
    color: var(--col-yellow);
    text-shadow: 0 0 15px rgba(246, 190, 44, 0.6);
}

/* Silver - 2nd place */
.profile-position.rank-2 .position-number {
    color: #C0C0C0;
    text-shadow: 0 0 15px rgba(192, 192, 192, 0.6);
}

/* Bronze - 3rd place */
.profile-position.rank-3 .position-number {
    color: #CD7F32;
    text-shadow: 0 0 15px rgba(205, 127, 50, 0.6);
}

.position-trophy {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 5px rgba(238, 204, 150, 0.3));
}

/* Gold trophy */
.profile-position.top-3 .position-trophy {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
}

/* Silver trophy */
.profile-position.rank-2 .position-trophy {
    filter: drop-shadow(0 0 8px rgba(192, 192, 192, 0.4));
}

/* Bronze trophy */
.profile-position.rank-3 .position-trophy {
    filter: drop-shadow(0 0 8px rgba(205, 127, 50, 0.4));
}

.position-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--col-secondary);
    letter-spacing: 1px;
    line-height: 1;
    margin-bottom: 2px;
}

.profile-characters {
    width: 100%;
    max-width: 800px;
}

.characters-label {
    font-size: 1.2rem;
    color: var(--col-secondary);
    font-weight: 600;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 20px;
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    max-height: 400px;
    overflow: scroll;
}
.characters-grid::-webkit-scrollbar{
	width: 5px;
	-ms-overflow-style: none;
	scrollbar-width: none;
}
.characters-grid::-webkit-scrollbar-thumb {
    background-color: var(--col-secondary);
    border-radius: 10px;
    border: 0px solid var(--col-secondary);
}

.character-card {
    background: linear-gradient(135deg, rgba(26, 29, 35, 0.9), rgba(45, 45, 45, 0.7));
    border-radius: 16px;
    padding: 20px;
    border: 2px solid var(--col-gray);
    transition: all 0.3s ease;
    position: relative;
    overflow: show;
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--col-secondary), var(--col-button));
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    border-color: var(--col-secondary);
}

.character-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.character-avatar {
    width: 48px !important;
    height: 48px !important;
    border-radius: 8px;
    border: 2px solid var(--col-gray);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.character-info {
    flex: 1;
}

.character-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--col-headline);
    margin-bottom: 5px;
}

.character-class {
    font-size: 1rem;
    color: var(--col-secondary);
    font-style: italic;
    margin-bottom: 5px;
}

.character-nation {
    font-size: 0.85rem;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.character-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(45, 45, 45, 0.5);
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.character-rank {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--col-yellow);
}

.character-points {
    font-size: 1rem;
    font-weight: 600;
    color: var(--col-secondary);
}

.character-level {
    font-size: 1rem;
    color: var(--col-txt);
}

.character-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(45, 45, 45, 0.3);
    border-radius: 6px;
    font-size: 0.9rem;
}

.stat-label {
    color: var(--col-txt);
    opacity: 0.8;
}

.stat-value {
    font-weight: 600;
    color: var(--col-secondary);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .leaderboard-item {
        grid-template-columns: 70px 50px 1fr auto;
        gap: 15px;
        padding: 18px 20px;
    }
    
    .player-level {
        display: none;
    }
}

@media (max-width: 768px) {
    .leaderboard-container {
        padding: 20px 15px;
    }
    
    .search-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-section input {
        width: 85%;
        max-width: 350px;
    }
    
    .filter-tabs {
        gap: 8px;
        padding: 12px;
    }
    
    .filter-btn {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .leaderboard {
        padding: 20px;
    }
    
    .leaderboard h3 {
        font-size: 2.2rem;
    }
    
    .leaderboard-item {
        grid-template-columns: 60px 40px 1fr auto;
        gap: 12px;
        padding: 15px;
    }
    
    .player-avatar {
        width: 40px;
        height: 40px;
    }
    
    .player-name {
        font-size: 1.1rem;
    }
    
    .player-class {
        font-size: 0.8rem;
    }
    
    .rank {
        font-size: 1.3rem;
    }
    
    .rank.first, .rank.second, .rank.third {
        font-size: 1.5rem;
    }
    
    .player-points {
        font-size: 1.1rem;
        min-width: 80px;
    }
    .modal-content {
        margin: 2% auto;
        padding: 20px 15px;
        width: 90%;
        max-height: 95dvh;
        border-radius: 12px;
    }
    
    /* Mobile modal profile styling */
    .player-profile-new {
        padding: 10px;
    }
    
    .profile-avatar-large {
        width: 80px;
        height: 80px;
        margin-bottom: 10px;
    }
    
    .profile-name {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    
    .profile-nation {
        padding: 6px 15px;
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    
    .profile-position {
        padding: 12px 20px;
        gap: 10px;
    }
    
    .position-number {
        font-size: 1.8rem;
    }
    
    .position-trophy {
        font-size: 1.4rem;
    }
    
    .position-text {
        font-size: 0.9rem;
    }
    
    .characters-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .character-card {
        padding: 15px;
        border-radius: 12px;
    }
    
    .character-header {
        gap: 12px;
        margin-bottom: 12px;
    }
    
    .character-avatar {
        width: 40px;
        height: 40px;
    }
    
    .character-name {
        font-size: 1.1rem;
    }
    
    .character-class {
        font-size: 0.9rem;
    }
    
    .character-nation {
        font-size: 0.75rem;
        padding: 2px 6px;
    }
    
    .character-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 8px;
    }
    
    .character-rank {
        font-size: 1rem;
    }
    
    .character-points {
        font-size: 0.9rem;
    }
    
    .character-level {
        font-size: 0.9rem;
    }
    
    .character-details {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .stat-item {
        padding: 5px 8px;
        font-size: 0.8rem;
    }

    .profiles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .player-profile h2 {
        font-size: 2.2rem;
    }
}

/* Mobile responsive adjustments for close button */
@media (max-width: 768px) {
    .close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .close {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    /* Extra small mobile optimizations */
    .modal-content {
        margin: 1% auto;
        padding: 15px 10px;
        width: 90%;
        max-height: 95dvh;
        border-radius: 8px;
    }
    
    .player-profile-new {
        padding: 5px;
    }
    
    .profile-avatar-large {
        width: 70px;
        height: 70px;
    }
    
    .profile-name {
        font-size: 1.5rem;
    }
    
    .profile-nation {
        padding: 4px 12px;
        font-size: 0.8rem;
        margin-bottom: 15px;
    }
    
    .profile-position {
        padding: 10px 15px;
        gap: 8px;
    }
    
    .position-number {
        font-size: 1.6rem;
    }
    
    .position-trophy {
        font-size: 1.2rem;
    }
    
    .position-text {
        font-size: 0.8rem;
    }
    
    .characters-label {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .character-card {
        padding: 12px;
    }
    
    .character-avatar {
        width: 36px;
        height: 36px;
    }
    
    .character-name {
        font-size: 1rem;
    }
    
    .character-class {
        font-size: 0.8rem;
    }
    
    .character-nation {
        font-size: 0.7rem;
    }
    
    .character-stats {
        padding: 6px;
        gap: 6px;
    }
    
    .character-rank {
        font-size: 0.9rem;
    }
    
    .character-points {
        font-size: 0.8rem;
    }
    
    .character-level {
        font-size: 0.8rem;
    }
    
    .character-details {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .stat-item {
        padding: 4px 6px;
        font-size: 0.75rem;
    }
}