/* Searchbar row for icon and searchbar */
.searchbar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}
.icon-btn {
    margin: 0 6px 0 0;
}

/* Search container: icon and search bar side by side */
.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    width: auto;
}
.searchbar-left-icons {
    display: flex;
    align-items: center;
    margin-right: 6px;
}
.icon-btn {
    background: linear-gradient(135deg, var(--accent) 60%, var(--accent-hover) 100%);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(14,165,233,0.10);
    margin: 0;
    transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}
.icon-btn:hover, .icon-btn:focus {
    background: linear-gradient(135deg, var(--accent-hover) 60%, var(--accent) 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(14,165,233,0.18);
}

/* Testers Modal Styles */

/* Testers Modal: match player modal style */
#testers-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-start !important;
    justify-content: center;
    z-index: 1000;
}
#testers-modal .login-modal-content {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(10, 15, 31, 0.98) 100%);
    border: 2px solid rgba(14, 165, 233, 0.2);
    border-radius: 20px;
    max-width: 800px;
    width: 95%;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8);
    position: relative;
    animation: slideUp 0.3s ease;
    background-attachment: fixed;
    padding: 0;
    margin-top: 60px;
}
#testers-modal .login-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px 12px 32px;
    border-bottom: 1px solid rgba(14, 165, 233, 0.1);
}
#testers-modal .login-modal-header h2 {
    font-size: 2rem;
    color: var(--accent);
    margin: 0;
}
#testers-modal .login-modal-close {
    position: static;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}
#testers-modal .login-modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(14, 165, 233, 0.6);
}
#testers-modal .login-modal-body {
    padding: 24px 32px 32px 32px;
    max-height: 70vh;
    overflow-y: auto;
}
#testers-list-container {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
}
.tester-card {
    background: linear-gradient(135deg, rgba(30,58,95,0.7) 0%, rgba(10,15,31,0.7) 100%);
    border: 1.5px solid rgba(14, 165, 233, 0.18);
    border-radius: 16px;
    padding: 28px 24px 20px 24px;
    min-width: 220px;
    max-width: 240px;
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 8px 32px rgba(14,165,233,0.10);
    transition: box-shadow 0.2s, border-color 0.2s;
    height: 360px;
    /* You can adjust 340px as needed for your content */
}
.tester-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 32px rgba(14,165,233,0.18);
}
.tester-avatar {
    width: 100px;
    height: 100px;
    border-radius: 16px;
    margin-bottom: 16px;
    background: #222;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(14,165,233,0.10);
    border: 4px solid #0ea5e9;
}
.tester-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0ea5e9;
    margin-bottom: 4px;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.tester-region {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-align: center;
}
.tester-modes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}
.tester-mode-badge {
    background: var(--accent);
    color: #fff;
    font-size: 0.95rem;
    padding: 5px 14px;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(14,165,233,0.10);
    margin-bottom: 2px;
    letter-spacing: 0.5px;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0f172a;
    --bg-darker: #0a0f1f;
    --bg-card: #1e3a5f;
    --border-color: rgba(100, 116, 139, 0.4);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --accent: #0ea5e9;
    --accent-hover: #06b6d4;
    --tier1: #0ea5e9;
    --tier2: #d4af37;
    --tier3: #cd7f32;
    --tier4: #888888;
    --tier5: #a9927d;
}

html, body {
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #0f172a 0%, #0a0f1f 100%);
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}
/* Header */
.header {
    background: linear-gradient(180deg, rgba(26, 40, 71, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    border-bottom: 2px solid rgba(14, 165, 233, 0.2);
    padding: 16px 40px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
    gap: 20px;
}

.logo-section {
    display: flex;
    gap: 12px;
}

.logo {
    height: 45px;
    width: auto;
    border-radius: 12px;
}

.logo-section h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--accent);
    text-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

.server-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(14, 165, 233, 0.08);
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.server-ip {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.server-info i {
    color: var(--accent);
    font-size: 14px;
}

/* Main Tabs */
.main-tabs {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 24px 40px;
    background: rgba(10, 15, 31, 0.6);
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
    flex-wrap: wrap;
}

.main-tab-btn {
    padding: 10px 28px;
    border: 2px solid rgba(100, 116, 139, 0.4);
    background: rgba(30, 58, 95, 0.3);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.main-tab-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(14, 165, 233, 0.05);
    transform: translateY(-2px);
}

.main-tab-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

/* Mode Tabs */
.mode-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 16px 40px;
    background: rgba(15, 23, 42, 0.4);
    border-bottom: 1px solid rgba(100, 116, 139, 0.15);
    flex-wrap: wrap;
}

.mode-tab-btn {
    padding: 7px 14px;
    border: 1px solid rgba(100, 116, 139, 0.3);
    background: rgba(30, 58, 95, 0.2);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-tab-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(14, 165, 233, 0.03);
}

.mode-tab-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* Content */
.content {
    flex: 1;
    padding: 30px 40px 40px;
    max-width: 100%;
    width: 100%;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Rankings Grid */
.rankings-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-top: 24px;
    width: 100%;
    padding: 0;
    overflow-x: auto;
}

/* Tier Card */
.tier-card {
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.6) 0%, rgba(26, 40, 71, 0.4) 100%);
    border: 2px solid rgba(100, 116, 139, 0.4);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.category-player-row {
    display: grid;
    /* columns: rank+avatar | player info | region | modes */
    grid-template-columns: 200px 1fr 120px auto;
    gap: 20px;
    align-items: center;
    padding: 0 20px 0 20px;
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.4) 0%, rgba(26, 40, 71, 0.2) 100%);
    border: 2px solid rgba(14, 165, 233, 0.08);
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
    width: 100%;
    overflow: visible; /* allow avatar to overlap */
}

.category-player-row + .category-player-row {
    margin-top: 18px;
}

.category-player-row:hover {
    /* avoid translate/shift that causes overflow; only change border/shadow */
    border-color: rgba(14, 165, 233, 0.18);
    box-shadow: 0 10px 28px rgba(14, 165, 233, 0.10);
}

/* Ensure the left combined rank/avatar block does not overflow */
.rank-player-section {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    padding-right: 8px;
    background: transparent;
}

.rank-badge {
    flex: 0 0 auto;
    margin: 0;
    z-index: 1;
    position: relative;
}

/* Modes (right column) - horizontally scrollable */
.modes-section {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 0;
    overflow-x: auto;
    overflow-y: visible;
    max-width: 400px;
    width: auto;
}

.mode-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 65px;
    max-width: 80px;
    flex-shrink: 0;
    background: transparent;
    border: none;
}

.mode-item .mode-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: contain;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    padding: 8px;
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow: 0 4px 10px rgba(0,0,0,0.35);
}

.tier-badge-rounded {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 13px;
    height: 26px;
    min-width: 32px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    margin: 0;
    font-weight: 600;
}

.tier-badge-rounded.tier-retired {
    background: #000 !important;
    color: #fff !important;
    box-shadow: none;
    border: 1px solid #fff;
}

@keyframes nitro-gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.player-name.nitro {
    background: linear-gradient(90deg, #8b5cf6, #3b82f6, #8b5cf6);
    background-size: 200% 200%;
    animation: nitro-gradient 3s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
}

/* Tier header (shared) */
.tier-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid rgba(14, 165, 233, 0.2);
    position: sticky;
    top: 0;
    z-index: 10;
    padding-top: 10px;
}

/* Stronger separator for Tier 1 */
.tier-card.tier-1 .tier-header {
    padding-bottom: 12px;
    border-bottom: 3px solid #f59e0b;
}

.tier-icon {
    font-size: 26px;
    line-height: 1;
}

.tier-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.tier-number {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-left: auto;
    background: rgba(14, 165, 233, 0.15);
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
}

/* Tier Colors */
.tier-card.tier-1 {
    border-color: #d97706;
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.08) 0%, rgba(30, 58, 95, 0.4) 100%);
}

.tier-card.tier-1 .tier-title {
    color: #d97706;
}

.tier-card.tier-1 .tier-header {
    border-bottom-color: rgba(217, 119, 6, 0.4);
}

.tier-card.tier-2 {
    border-color: #9ca3af;
    background: linear-gradient(135deg, rgba(156, 163, 175, 0.08) 0%, rgba(30, 58, 95, 0.4) 100%);
}

.tier-card.tier-2 .tier-title {
    color: #9ca3af;
}

.tier-card.tier-2 .tier-header {
    border-bottom-color: rgba(156, 163, 175, 0.4);
}

.tier-card.tier-3 {
    border-color: #92472f;
    background: linear-gradient(135deg, rgba(146, 71, 47, 0.08) 0%, rgba(30, 58, 95, 0.4) 100%);
}

.tier-card.tier-3 .tier-title {
    color: #92472f;
}

.tier-card.tier-3 .tier-header {
    border-bottom-color: rgba(146, 71, 47, 0.4);
}

.tier-card.tier-4 {
    border-color: #6b7280;
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.08) 0%, rgba(30, 58, 95, 0.4) 100%);
}

.tier-card.tier-4 .tier-title {
    color: #6b7280;
}

.tier-card.tier-4 .tier-header {
    border-bottom-color: rgba(107, 114, 128, 0.4);
}

.tier-card.tier-5 {
    border-color: #78654d;
    background: linear-gradient(135deg, rgba(120, 101, 77, 0.08) 0%, rgba(30, 58, 95, 0.4) 100%);
}

.tier-card.tier-5 .tier-title {
    color: #78654d;
}

.tier-card.tier-5 .tier-header {
    border-bottom-color: rgba(120, 101, 77, 0.4);
}

.tier-card.tier-unknown {
    border-color: rgba(107, 114, 128, 0.6);
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.08) 0%, rgba(30, 58, 95, 0.4) 100%);
}

.tier-card.tier-unknown .tier-title {
    color: #6b7280;
}

.tier-card.tier-unknown .tier-header {
    border-bottom-color: rgba(107, 114, 128, 0.4);
}

/* Players List */
.players-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    overflow-y: auto;
    min-height: 250px;
}

/* Ensure long names inside tier lists truncate with ellipsis */
.tier-card .players-list .player-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    background: rgba(100, 116, 139, 0.12);
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid rgba(100, 116, 139, 0.2);
    cursor: pointer;
}

.player-item:hover {
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(14, 165, 233, 0.4);
}

.player-rank {
    font-weight: 700;
    font-size: 13px;
    color: #f59e0b;
    min-width: 28px;
    text-align: center;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.player-rank div {
    line-height: 1;
}

.player-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #000;
    font-size: 11px;
    flex-shrink: 0;
    overflow: hidden;
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Truncate names inside player-card (overall view) */
.player-card .player-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-status {
    font-size: 11px;
    color: var(--text-secondary);
}

.player-points {
    font-weight: 700;
    color: var(--accent);
    font-size: 12px;
    min-width: 45px;
    text-align: right;
    display: none;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 30px 10px;
    color: var(--text-secondary);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 13px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .header-content {
        padding: 0 20px;
    }

    .header {
        padding: 15px 20px;
    }

    .main-tabs, .mode-tabs {
        padding: 15px 20px;
        gap: 10px;
    }

    .content {
        padding: 20px;
    }

    .rankings-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .logo-section h1 {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 12px 20px;
    }

    .header-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .logo-section {
        width: 100%;
        justify-content: center;
    }

    .logo-section h1 {
        font-size: 20px;
    }

    .profile-section {
        width: 100%;
        flex: none;
    }

    .server-info {
        width: 100%;
        justify-content: center;
    }

    .main-tabs, .mode-tabs {
        padding: 12px 15px;
        gap: 8px;
    }

    .main-tab-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .mode-tab-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .content {
        padding: 15px;
    }

    .rankings-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .tier-card {
        padding: 15px;
    }

    .player-item {
        padding: 10px;
        gap: 8px;
    }

    .player-avatar {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }

    .player-rank {
        font-size: 13px;
    }

    .player-name {
        font-size: 13px;
    }

    .tier-title {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 8px 12px;
    }

    .header-content {
        gap: 8px;
        flex-wrap: wrap;
    }

    .logo {
        height: 36px;
    }

    .logo-section {
        gap: 8px;
        flex: 1;
        min-width: 120px;
    }

    .logo-section h1 {
        font-size: 16px;
        letter-spacing: 0.5px;
    }

    .profile-section {
        width: 100%;
        order: 3;
        min-width: 100%;
    }

    .login-prompt-content {
        padding: 8px 12px;
        width: 300px;
        display: flex;
        justify-content: center;
    }

    .login-prompt-content span {
        display: none;
    }

    .login-prompt-content i {
        font-size: 14px;
    }

    .profile-info {
        gap: 6px;
        padding: 6px 12px;
    }

    .profile-label {
        display: none;
    }

    .profile-ign {
        font-size: 12px;
    }

    .profile-btn {
        padding: 4px 8px;
        font-size: 10px;
    }

    .server-info {
        display: none;
    }

    .main-tabs, .mode-tabs {
        padding: 8px 12px;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .main-tab-btn {
        padding: 6px 12px;
        font-size: 12px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .mode-tab-btn {
        padding: 5px 10px;
        font-size: 11px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .content {
        padding: 8px;
        overflow-x: hidden;
        box-sizing: border-box;
        width: 100%;
    }

    .rankings-grid {
        gap: 8px;
        grid-template-columns: 1fr;
        overflow-x: hidden;
    }

    .tier-card {
        padding: 10px 8px;
        min-width: 0;
        overflow: hidden;
    }

    .tier-header {
        gap: 8px;
        padding-bottom: 10px;
    }

    .tier-icon {
        font-size: 20px;
    }

    .tier-title {
        font-size: 16px;
    }

    .tier-number {
        font-size: 12px;
    }

    .player-item {
        padding: 8px;
        gap: 6px;
    }

    .player-rank {
        font-size: 12px;
        min-width: 20px;
    }

    .player-avatar {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }

    .player-name {
        font-size: 12px;
    }

    .player-points {
        font-size: 12px;
        min-width: 40px;
    }
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.stats-section {
  padding: 40px;
}

.stats-title {
  text-align: center;
  font-size: 2.2rem;
  color: var(--text);
}

.stats-subtitle {
  text-align: center;
  opacity: 0.75;
  margin-bottom: 30px;
}

.kits-section {
  padding: 40px;
}

.kits-title {
  font-size: 2.2rem;
  margin-bottom: 6px;
  text-align: center;
}

.kits-subtitle {
  opacity: 0.75;
  margin-bottom: 30px;
  text-align: center;
}

.kits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 180px));
  gap: 24px;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
}


.kit-card {
  background: var(--gray2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.35);
}

.kit-card img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  margin-bottom: 10px;
}

.kit-name {
  font-weight: 600;
}


.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}

.stats-card {
  background: var(--gray2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

body {
    margin: 0;
    background: var(--gray2);
    font-family: Inter, sans-serif;
    color: var(--text);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================= */
/* LOADING SCREEN */
/* ============================= */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gray);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-screen.show {
    opacity: 1;
    pointer-events: all;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top: 3px solid rgba(255,255,255,0.8);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    margin: 0;
}

/* ============================= */
/* SMOOTH TRANSITIONS */
/* ============================= */

* {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* ============================= */
/* SECTION ANIMATIONS */
/* ============================= */

.active-section {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden-section {
    display: none !important;
}

/* ============================= */
/* HOME PAGE */
/* ============================= */

.home-section {
    min-height: 100vh;
    padding: 60px 40px 80px;
    background: var(--gray2);
    animation: fadeIn 0.6s ease;
}

.home-hero {
    text-align: center;
    margin-bottom: 80px;
    padding-top: 40px;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.hero-title {
    font-size: 56px;
    font-weight: 900;
    letter-spacing: -1px;
    color: rgba(255,255,255,0.95);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
}

.title-icon {
    font-size: 64px;
    filter: drop-shadow(0 4px 12px rgba(255,215,0,0.3));
}

.hero-subtitle {
    font-size: 20px;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
    letter-spacing: 0.5px;
    margin: 0;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.home-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    pointer-events: auto;
}

.home-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.home-card:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

.home-card:hover::before {
    opacity: 1;
}

.card-icon {
    font-size: 48px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.card-title {
    font-size: 22px;
    font-weight: 800;
    color: rgba(255,255,255,1);
    margin: 0;
    letter-spacing: 0.3px;
}

.card-description {
    font-size: 14px;
    color: rgba(255,255,255,0.65);
    margin: 0;
    line-height: 1.6;
}

.card-stats {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    border-left: 3px solid rgba(255,255,255,0.15);
}

.card-stats span {
    color: rgba(255,255,255,0.85);
    font-weight: 700;
    font-size: 14px;
}

.card-button {
    margin-top: auto;
    padding: 12px 20px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.95);
    font-size: 14px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

.card-button:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255,255,255,0.08);
}

/* Card color variants */
.fighters-card .card-icon {
    filter: drop-shadow(0 2px 8px rgba(244, 63, 94, 0.3));
}

.builders-card .card-icon {
    filter: drop-shadow(0 2px 8px rgba(34, 197, 94, 0.3));
}

.modes-card .card-icon {
    filter: drop-shadow(0 2px 8px rgba(96, 165, 250, 0.3));
}

.testers-card .card-icon {
    filter: drop-shadow(0 2px 8px rgba(168, 85, 247, 0.3));
}

.docs-card .card-icon {
    filter: drop-shadow(0 2px 8px rgba(14, 165, 233, 0.3));
}

.application-card .card-icon {
    filter: drop-shadow(0 2px 8px rgba(59, 130, 246, 0.3));
}

.home-footer {
    text-align: center;
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    font-size: 15px;
    font-weight: 500;
}

.discord-link {
    color: rgba(88, 101, 242, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    cursor: pointer;
}

.discord-link:hover {
    color: rgba(88, 101, 242, 0.8);
}

/* Mobile Home Page */
@media (max-width: 768px) {
    .home-section {
        padding: 40px 20px 60px;
    }

    .hero-title {
        font-size: 40px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .home-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .home-card {
        padding: 24px 20px;
    }
}

.modal-box input {
  width: 300px;
  margin: 8px auto;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #020617;
  color: #e5e7eb;
  font-size: 14px;
  justify-content: center;
  display: flex;
}

.auth-button-container {
    display: flex;
}

.modal-box h2 {
    text-align: center;
}

.auth-form {
    justify-content: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.modal-box input::placeholder {
  color: #64748b;
}

.modal-box input:focus {
  outline: none;
  border-color: var(--gray2);
}

.auth-buttons {
  display: flex;
  gap: 10px;
}

.auth-buttons button {
  background: transparent;
  border: 1px solid var(--gray);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-buttons button:hover {
  background: var(--accent);
  color: #fff;
}

/* ============================= */
/* PROFILE DESIGNER */
/* ============================= */

.profile-designer {
  width: 380px;
  text-align: center;
}

.profile-card-preview {
  background: rgba(255,255,255,0.06);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

/* Banner (top only editable) */
.profile-banner {
  height: 120px;
  background-size: cover;
  background-position: center;
  position: relative;
}

/* Pencil icon */
.edit-banner-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.55);
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  color: white;
  transition: 0.2s;
}

.edit-banner-btn:hover {
  background: rgba(0,0,0,0.8);
}

/* Card body */
.profile-card-body {
  padding: 16px;
  display: flex;
}

.designer-avatar {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: 3px solid var(--gray2);
  background: var(--gray);
}

#designer-name {
  margin-left: 15px;
  font-size: 20px;
  font-weight: 800;
}

/* Banner selector */
.banner-selector h4 {
  margin-bottom: 10px;
  text-align: center;
}

.banner-options {
  display: flex;
  gap: 10px;
  justify-content: center; /* centers items horizontally in each cell */
  align-items: center;   /* optional: centers items vertically */
  flex-wrap: wrap;
}

.banner-options img {
  width: 90px;
  height: 50px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: 0.2s;
}

.banner-options img:hover {
  border-color: white;
}

/* User profile dropdown container */
.user-profile-dropdown {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center; /* Vertically center avatar */
}

/* Avatar styling */
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  object-fit: cover;
  transition: transform 0.2s;
}

.user-profile-dropdown:hover .user-avatar {
  transform: scale(1.05); /* Slight pop on hover */
}

/* Profile menu dropdown */
.profile-menu {
  position: absolute;
  top: 50px; /* below avatar */
  right: 0;
  background: var(--gray2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 0;
  width: 160px; 
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.25s ease;
  z-index: 1000;
}

/* Show dropdown on click */
.user-profile-dropdown.active .profile-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Arrow pointing up, aligned to the right by default */
.profile-menu::before {
  content: '';
  position: absolute;
  top: -8px; /* above menu */
  right: 16px; /* distance from right edge */
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--gray2); /* arrow color same as menu */
  z-index: 1001;
}

/* Menu items */
.profile-menu div {
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s, color 0.2s;
}

.profile-menu div:hover {
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
}

/* Hidden class */
.hidden {
  display: none;
}

/* === MOBILE SPECIFIC STYLES === */
@media (max-width: 768px) {
  /* Move dropdown to the right of avatar */
  .profile-menu {
    right: auto;
  }

  /* Move arrow to the left side */
  .profile-menu::before {
    left: 16px; /* distance from left edge */
    right: auto;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--gray2);
  }
}


.mode-btn {
    padding: 10px 15px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.95);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn img.mode-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  pointer-events: none;
  filter: brightness(1.1);
}

.mode-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

.mode-btn.active {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.2);
}

/* Info icon */
.mode-info {
  margin-left: auto;
  font-size: 13px;
  opacity: 0.6;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-info:hover {
  opacity: 1;
  transform: scale(1.2);
}

/* Popup container */
.mode-info-popup {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--gray2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px;
  display: none;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
}

/* Popup image */
.mode-info-popup img {
  width: 140px;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
}

/* Visible state */
.mode-btn.show-info .mode-info-popup {
  display: block;
  animation: popupFadeIn 0.2s ease;
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ranking-option {
  background: rgba(255,255,255,0.05);
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.10);
  transition: 0.25s;

  /* NEW — aligns icon + text */
  display: flex;
  align-items: center;
  gap: 8px;
}

.ranking-option img.mode-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  pointer-events: none;
}

.ranking-option:hover {
  background: rgba(255,255,255,0.14);
  box-shadow: 0 0 16px rgba(255,255,255,0.16);
}

/* Nitro gradient styling for text */
.player-name.nitro,
.modal-name.nitro,
.modal-info-row.nitro,
.modal-subtitle.nitro,
.close-modal-text.nitro {
    background: linear-gradient(
        to right,
        #7953cd 20%,
        #00affa 30%,
        #0190cd 70%,
        #764ada 80%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 500% auto;
    animation: textShine 5s ease-in-out infinite alternate;
}

/* Animations */
@keyframes textShine {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

.modal-avatar.nitro {
    background: linear-gradient(
        to right,
        #7953cd 20%,
        #00affa 30%,
        #0190cd 70%,
        #764ada 80%
    );
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-text-fill-color: transparent;
    background-size: 500% auto;
    animation: textShine 5s ease-in-out infinite alternate;
}

/* APPLICATION SECTION */
.application-section {
    margin: 60px auto;
    padding: 40px;
    width: 90%;
    max-width: 700px;
    background: var(--gray);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-align: center;
}

.application-section h1 {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 10px;
}

.application-section p {
    opacity: 0.8;
    margin-bottom: 30px;
}

/* Form */
.application-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 700;
    font-size: 14px;
    opacity: 0.85;
}

.form-group > select {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 10px;
}

/* The dropdown options */
.form-group > select > option {
  background: #1e1e1e; /* solid color works best */
  color: var(--text);
}

.form-group input,
.form-group textarea {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 15px;
    outline: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    opacity: 0.5;
}

/* Submit button */
.application-submit {
    margin-top: 10px;
    padding: 12px;
    font-size: 16px;
    font-weight: 800;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    background: rgba(255,255,255,0.15);
    color: var(--text);
    transition: 0.25s ease;
}

.application-submit:hover {
    background: rgba(255,255,255,0.25);
    box-shadow: 0 0 16px rgba(255,255,255,0.2);
}

/* ========================= */
/* Mobile Optimizations */
/* ========================= */
@media (max-width: 600px) {

  .application-section {
    padding: 12px 6px;
    width: calc(100% - 24px);
    border-radius: 14px;
  }

  .application-section h1 {
    font-size: 24px;
    line-height: 1.2;
  }

  .application-section p {
    font-size: 14px;
    margin-bottom: 22px;
  }

  .application-form {
    gap: 14px;
  }

  .form-group label {
    font-size: 13px;
  }

  .form-group input,
  .form-group textarea,
  .form-group > select {
    font-size: 16px; /* prevents iOS zoom */
    padding: 12px 14px;
    border-radius: 10px;
  }

  .form-group textarea {
    min-height: 90px;
  }

  .application-submit {
    margin-top: 16px;
    padding: 14px;
    font-size: 16px;
    width: 100%;
    border-radius: 14px;
  }
}


/* ============================= */
/* MODE LEADERBOARD UI (IMAGE STYLE) */
/* ============================= */

.mode-title {
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  margin: 30px 0 10px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 30px;
}

.mode-tier-card {
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-tier-header {
  font-size: 18px;
  font-weight: 800;
}

.footer {
    text-align: center;
    padding: 30px 20px;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    background: var(--gray);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: auto;
    transition: color 0.3s ease;
}

.footer:hover {
    color: rgba(255, 255, 255, 0.75);
}

/* ============================= */
/* LEADERBOARDS SECTION */
/* ============================= */

.leaderboards-section {
    width: 90%;
    max-width: 1400px;
    margin: 40px auto;
    padding: 20px;
}

.leaderboards-mode-buttons {
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    justify-content: center;
}

.leaderboard-mode-btn {
    padding: 10px 15px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.95);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.leaderboard-mode-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.25);
}

.leaderboard-mode-btn.active {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}

.leaderboards-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.leaderboard-mode-section {
    margin-bottom: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.mode-section-title {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    margin: 25px 0 15px 0;
    padding: 0;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.leaderboard-player-row {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255,255,255,0.02);
    border-left: 4px solid;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    border-right: 0;
}

.leaderboard-player-row:hover {
    background: rgba(255,255,255,0.05);
    border-right: 3px solid currentColor;
}

.leaderboard-rank {
    font-weight: 800;
    color: rgba(255,255,255,0.6);
    min-width: 35px;
    text-align: center;
}

.leaderboard-tier-badge {
    font-weight: 800;
    font-size: 18px;
    color: rgba(255,255,255,0.85);
    min-width: 30px;
    text-align: center;
    margin-left: 10px;
}

.leaderboard-player-name {
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    flex: 1;
    margin-left: 15px;
}

.leaderboard-points {
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    min-width: 60px;
    text-align: right;
}

/* ============================= */
/* MODES SECTION */
/* ============================= */

.modes-section {
    width: 90%;
    max-width: 1400px;
    margin: 40px auto;
    padding: 20px;
}

.modes-section h1 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 40px;
}

.modes-categories-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
}

.mode-category-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.mode-category-btn {
    padding: 12px 24px;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.85);
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mode-category-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.mode-category-btn.active {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
    box-shadow: 0 0 20px rgba(100,200,255,0.2);
}

.mode-category-content {
    width: 100%;
}

.modes-list-display {
    display: none;
}

.modes-separator {
    height: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 1px;
}

.modes-category-label {
    font-size: 20px;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    margin: 0;
    padding: 0 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modes-in-category {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 10px;
}

.mode-badge {
    padding: 8px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    font-weight: 600;
}

#modes-players-container {
    display: flex;
    flex-direction: column;
}

.mode-category {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 20px;
    overflow: hidden;
}

.mode-category-title {
    font-size: 18px;
    font-weight: 800;
    color: rgba(255,255,255,0.95);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.mode-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mode-item {
    padding: 10px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    background: transparent;
    border: none;
}

.mode-item:hover {
    transform: translateX(5px);
}

/* ============================= */
/* MODE LEADERBOARD - IMAGE STYLE */
/* ============================= */

.builders-section {
  width: 90%;
  margin: 40px auto;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 30px;
}

/* ============================= */
/* BUILDERS REGION TABS */
/* ============================= */

.builders-region-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 12px;
    background: rgba(255,255,255,0.02);
    padding: 8px 12px 12px;
    border-radius: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.builders-region-tab-btn {
    padding: 8px 14px;
    border: none;
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-radius: 8px;
}

.builders-region-tab-btn:hover {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.08);
    transform: translateY(-1px);
}

.builders-region-tab-btn.active {
    color: rgba(255,255,255,1);
    background: rgba(255,255,255,0.12);
    border-bottom-color: rgba(255,255,255,0.9);
    box-shadow: 0 2px 8px rgba(255,255,255,0.06);
}

.builders-table-header {
    display: none;
}

.builders-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mode-title {
  text-align: center;
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 30px;
}

.mode-tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
}

.mode-tier-column {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;

  flex: 1 1 320px;      /* << responsive width */
  max-width: 320px;     /* << prevents giant columns on desktop */

  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-tier-header {
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ============================= */
/* MODE PLAYER CARDS - Right Region Box Inside Card */
/* ============================= */

.mode-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

/* Left side: avatar + name + tiers */
.mode-player-left {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;       /* take all remaining width */
}

/* Player avatar */
.mode-player img {
  width: 30px;
  height: 30px;
  border-radius: 6px;
}

/* Player name and optional sign */
.mode-player span {
  font-weight: 700;
}


/* ============================= */
/* Right region box inside the card */
.region-box {
  position: relative;
  width: 8px;                /* initial thin line */
  height: 40px;              /* match card height */
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;            /* keep width */
  transition: width 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;   /* center text */
  color: white;
  font-weight: 900;          /* bold */
  text-transform: uppercase;
  padding: 0 6px;            /* horizontal padding inside box */
  box-sizing: border-box;
  background-color: gray;     /* fallback */
}

/* Region colors */
.mode-player[data-region="na"] .region-box { background-color: #ef4444; }
.mode-player[data-region="eu"] .region-box { background-color: #22c55e; }
.mode-player[data-region="as"] .region-box { background-color: #7c22c5; }
.mode-player[data-region="sa"] .region-box { background-color: #FF8AC4; }
.mode-player[data-region="me"] .region-box { background-color: #FFBF00; }
.mode-player[data-region="au"] .region-box { background-color: #4169E1; }
.mode-player[data-region="af"] .region-box { background-color: #FF7518; }

/* Match empty-tier size + add rarity-colored border */
.tier[data-tier="1"] { border: 2px solid #f87171; } /* red */
.tier[data-tier="2"] { border: 2px solid #0ea5e9; } /* cyan */
.tier[data-tier="3"] { border: 2px solid #34d399; } /* green */
.tier[data-tier="4"] { border: 2px solid #60a5fa; } /* blue */
.tier[data-tier="5"] { border: 2px solid #a78bfa; } /* purple */

/* Text inside region box */
.region-box span {
  display: none;             /* hidden initially */
  text-align: center;
  width: 100%;
}

/* Hover: expand box and show text */
.mode-player:hover .region-box {
  width: 50px;              /* partially expand from right to left */
}

.mode-player:hover .region-box span {
  display: inline;
}

/* FIGHTERS - ALL MODES VIEW */
/* ============================= */

.leaderboard {
    width: 90%;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

#players-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.table-row.player-row {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255,255,255,0.04);
    border-left: 4px solid;
    border-radius: 8px;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.player-row:hover {
    background: rgba(255,255,255,0.08);
}

.player-row .rank {
    font-weight: 800;
    color: rgba(255,255,255,0.6);
    min-width: 40px;
    text-align: center;
}

.player-row .player-name {
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    min-width: 120px;
}

.player-row .player-points {
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    margin-left: auto;
    min-width: 70px;
    text-align: right;
}

.player-row .tiers-container {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 300px;
    max-height: 60px;
    overflow-y: auto;
}

.player-row .tier {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    position: relative;
    flex-shrink: 0;
}

.player-row .tier img {
    width: 24px;
    height: 24px;
    opacity: 0.8;
}

.player-row .tier span {
    position: absolute;
    font-weight: 800;
    font-size: 10px;
    bottom: 1px;
    right: 2px;
    color: rgba(255,255,255,0.95);
}

.player-row .tier.empty {
    background: transparent;
    border: 2px dashed rgba(255,255,255,0.2);
}

/* TESTERS SECTION */
/* ============================= */

.builder-option {
  background: rgba(255,255,255,0.06);
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.10);
  transition: 0.25s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.builder-option img.mode-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  pointer-events: none;
}

.builder-option:hover {
  background: rgba(255,255,255,0.14);
  box-shadow: 0 0 16px rgba(255,255,255,0.16);
}

/* ============================= */
/* BUILDER TOP 3 COLORS */
/* ============================= */

.builder-card.gold {
  border-left: 8px solid gold;
  box-shadow: inset 0 0 20px rgba(14, 165, 233, 0.1);
}

.builder-card.silver {
  border-left: 8px solid silver;
  box-shadow: inset 0 0 20px rgba(229, 231, 235, 0.1);
}

.builder-card.bronze {
  border-left: 8px solid #cd7f32;
  box-shadow: inset 0 0 20px rgba(249, 115, 22, 0.1);
}

/* ============================= */
/* RESPONSIVE STYLES */
/* ============================= */
/* Subjects dropdown options: make them match Rankings/Builders */
.subject-btn {
  background: rgba(255,255,255,0.06);
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.10);
  transition: 0.25s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.subject-btn:hover {
  background: rgba(255,255,255,0.14);
  box-shadow: 0 0 16px rgba(255,255,255,0.16);
}

.subject-btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  pointer-events: none;
}

.testers-section {
  margin: 60px auto;
  padding: 40px;
  width: 90%;
  max-width: 1200px;
  background: var(--gray);
  border: 1px solid var(--border);
  border-radius: 20px;
  text-align: center;
}

.testers-title {
  font-size: 36px;
  font-weight: 900;
  margin-bottom: 6px;
}

.testers-subtitle {
  opacity: 0.75;
  margin-bottom: 30px;
  font-size: 16px;
}

/* Filters */
.testers-filters {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

/* Dark background for tester filters */
.testers-filters select {
    background: var(--gray2); /* dark background */
    color: var(--text);       /* white text */
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
}

/* Options inside the dropdown */
.testers-filters select option {
    background: var(--gray2); /* dark background for options */
    color: var(--text);       /* white text */
}

/* Optional: focused state */
.testers-filters select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--gray2);
    color: var(--text);
}

/* Grid */
.testers-grid {
  display: grid;
  gap: 18px;
}

/* Tester Card */
.tester-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: 0.25s ease;
  cursor: pointer;
}

.tester-card:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-3px);
}

/* Avatar */
.tester-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
}

/* Info */
.tester-info {
  text-align: left;
  flex: 1;
}

.tester-name {
  font-size: 17px;
  font-weight: 800;
}

.tester-meta {
  font-size: 13px;
  opacity: 0.7;
}

/* Region badge */
.tester-region {
  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 8px;
  color: white;
  text-transform: uppercase;
}

.tester-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tester-mode-badge {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Region colors */
.tester-region.na { background: #ef4444; }
.tester-region.eu { background: #22c55e; }
.tester-region.as { background: #7c22c5; }
.tester-region.sa { background: #FF8AC4; }
.tester-region.me { background: #FFBF00; }
.tester-region.au { background: #4169E1; }
.tester-region.af { background: #FF7518; }

/* Mobile */
@media (max-width: 600px) {
  .testers-section {
    padding: 20px;
  }

  .testers-title {
    font-size: 26px;
  }
}

/* Empty tier placeholder (keeps height) */
.mode-empty {
  opacity: 0.25;
  font-size: 13px;
  text-align: center;
  padding-top: 20px;
}


/* NAVBAR */
.navbar {
    height: 60px;
    padding: 0 40px;
    background: var(--gray);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 100;
}

.logo-img {
    height: 40px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.logo-img:hover {
    opacity: 0.85;
}

/* NAV CENTER */
.nav-center {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-center a,
.dropdown-trigger {
    cursor: pointer;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.25s ease;
    background: transparent;
    border: none;
}

.nav-center a:hover,
.dropdown-trigger:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.95);
    transform: none;
}

/* ============================= */
/* SUBJECT BUTTONS (BUILDERS) */
/* ============================= */

/* Make subject buttons match mode/button styling */
.subject-btn {
  background: rgba(255, 255, 255, 0.06);
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.10);
  transition: 0.25s;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative; /* same as mode-btn for any popup positioning */
}

.subject-btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  pointer-events: none;
}

.subject-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.16);
}

/* Optional: active state when clicked (matches mode-btn) */
.subject-btn.active {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.25);
}


.player-card,
.mode-player {
  cursor: pointer;
}

.dropdown-trigger {
  min-width: 140px;
  justify-content: space-between;
}

.dropdown-menu {
  pointer-events: auto;
}

.nav-center a:hover,
.dropdown-trigger:hover {
    background: var(--accent);
    box-shadow: 0 0 12px rgba(255,255,255,0.08);
}

.tier {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    text-align: center;
    padding: 4px 6px;
    border-radius: 6px;
    color: black;
    width: 40px;       /* fixed width */
    min-width: 40px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Tier images */
.tier img {
    width: 28px;       /* fixed size */
    height: 28px;
    object-fit: contain;
    margin-bottom: 4px;
}

/* Background colors for tiers */
.tier[data-tier="1"]:not(.retired) { background-color: #f87171; } /* red */
.tier[data-tier="2"]:not(.retired) { background-color: #0ea5e9; } /* cyan */
.tier[data-tier="3"]:not(.retired) { background-color: #34d399; } /* green */
.tier[data-tier="4"]:not(.retired) { background-color: #60a5fa; } /* blue */
.tier[data-tier="5"]:not(.retired) { background-color: #a78bfa; } /* purple */

/* Retired mode */
.tier.retired {
  background-color: #3f3f46; /* gray */
}

/* Empty tier for Unknown */
.tier.empty {
    background: transparent;
    border: 2px dashed rgba(255,255,255,0.2);
    width: 40px;
    min-width: 40px;
    height: 40px;        /* ⬅️ ensures visible size */
    min-height: 40px;    /* ⬅️ prevents squishing */
    flex: 0 0 auto;      /* ⬅️ stops flex-shrinking */
    flex-shrink: 0;
}

.tier.unknown {
    background: transparent;
    border: 2px dashed rgba(255,255,255,0.2);
}

/* MODAL TIERS - wrap inside modal */
.modal-box .tiers {
    display: flex;
    flex-wrap: wrap;      /* ✅ allow wrapping */
    gap: 8px;             /* spacing between tiers */
    justify-content: center; /* center inside modal */
    max-width: 100%;      /* never overflow modal width */
    overflow: hidden;     /* clip any accidental overflow */
}


.modal-box .tier {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    text-align: center;
    padding: 4px 6px;
    border-radius: 6px;
    color: black;
    width: 40px;
    height: 40px;
    cursor: default;
}

.modal-box .tier img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    margin-bottom: 4px;
}

.modal-box .tier.empty {
    background: transparent;
    border: 2px dashed rgba(255,255,255,0.2);
}

.modal-box .tier:hover {
    transform: none; /* remove hover transform in modal */
    box-shadow: none;
}

.tier.empty span {
    display: none;    /* no text under empty tier */
}

/* Optional hover effect */
.tier:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.tiers {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;       /* keep tiers in a single row */
    gap: 6px;
    width: 100%;
    flex: 1 1 auto;          /* allow it to grow/shrink properly */
    min-width: 0;            /* prevent flexbox from constraining width */

    justify-content: flex-start;
    align-items: center;
}

/* DROPDOWN */
.dropdown-container {
    position: relative;    /* Slightly higher than navbar to appear on top */
}

/* FIXED — no more gap */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 2px); /* 2px cushion WITHOUT creating a hover gap */
    left: 0;
    width: 220px;

    background: rgba(17, 24, 39, 0.98);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    padding: 14px;
    border-radius: 14px;

    display: none;
    flex-direction: column;
    gap: 10px;

    box-shadow: 0 10px 35px rgba(0,0,0,0.55);

    /* Smooth drop animation */
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease;
}

.dropdown-container.open .dropdown-menu {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* Trigger hover effect */
.dropdown-container .dropdown-trigger {
    transition: 0.25s ease;
}

/* Hover effect */
.dropdown-container:hover .dropdown-trigger {
    background: rgba(255,255,255,0.14);
}

/* Keep hover effect when dropdown is open (clicked) */
.dropdown-container.open .dropdown-trigger {
    background: rgba(255,255,255,0.14); /* same as hover */
    box-shadow: 0 0 12px rgba(255,255,255,0.08); /* optional for emphasis */
}

/* ============================= */
/* MODE CATEGORIES */
/* ============================= */

.mode-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 12px;
    background: rgba(255,255,255,0.02);
    padding: 8px 12px 12px;
    border-radius: 10px;
}

.mode-tab-btn {
    padding: 8px 16px;
    border: none;
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-radius: 8px;
}

.mode-tab-btn:hover {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.08);
    transform: translateY(-1px);
}

.mode-tab-btn.active {
    color: rgba(255,255,255,1);
    background: rgba(255,255,255,0.12);
    border-bottom-color: rgba(255,255,255,0.9);
    box-shadow: 0 2px 8px rgba(255,255,255,0.06);
}

.mode-tab-content {
    display: none;
    animation: tabFadeIn 0.3s ease;
}

.mode-tab-content.active {
    display: block;
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mode-category {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.mode-category:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.mode-category-header {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.55);
    padding: 8px 0;
    margin-bottom: 8px;
}

.mode-category-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Discord Buttons */
.discord-btn {
    background: rgba(255,255,255,0.06) !important;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    font-size: 15px;

    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.25s;
    border: 1px solid rgba(255,255,255,0.10);
}

.discord-btn:hover {
    background: rgba(255,255,255,0.14);
    box-shadow: 0 0 16px rgba(255,255,255,0.16);
}

/* SEARCH BAR */
.search-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.07);
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(12px);
    transition: all 0.25s ease;
}

.search-wrapper:hover,
.search-wrapper:focus-within {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.2);
    box-shadow: 0 4px 16px rgba(255,255,255,0.08);
}

.search-wrapper i {
    opacity: 0.7;
    font-size: 14px;
}

.searchbar {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    width: 180px;
}

.searchbar::placeholder {
    color: rgba(255,255,255,0.4);
}

/* LEADERBOARD BASE */
.leaderboard {
    margin: 50px auto;
    padding: 30px;
    width: 85%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 1400px;
}

/* ============================= */
/* FIGHTERS REGION TABS */
/* ============================= */

.fighters-region-tabs {
    display: flex !important;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    padding: 8px 12px;
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

.fighters-region-tab-btn {
    padding: 8px 14px;
    border: 1px solid transparent;
    border-bottom: 2px solid transparent;
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fighters-region-tab-btn:hover {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.08);
    transform: translateY(-1px);
}

.fighters-region-tab-btn.active {
    color: rgba(255,255,255,1);
    background: rgba(255,255,255,0.12);
    border-bottom-color: rgba(255,255,255,0.9);
    box-shadow: 0 2px 8px rgba(255,255,255,0.06);
}

/* ============================= */
/* LEADERBOARD MODE TABS */
/* ============================= */

.leaderboard-mode-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 12px;
    background: rgba(255,255,255,0.02);
    padding: 8px 12px 12px;
    border-radius: 10px;
}

.leaderboard-mode-tab-btn {
    padding: 8px 16px;
    border: none;
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-radius: 8px;
}

.leaderboard-mode-tab-btn:hover {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.08);
    transform: translateY(-1px);
}

.leaderboard-mode-tab-btn.active {
    color: rgba(255,255,255,1);
    background: rgba(255,255,255,0.12);
    border-bottom-color: rgba(255,255,255,0.9);
    box-shadow: 0 2px 8px rgba(255,255,255,0.06);
}

/* ============================= */
/* Tier hover tooltip */
/* ============================= */

.tier {
  position: relative;
}

/* Tooltip box */
.tier::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);

  background: rgba(17, 24, 39, 0.95);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;

  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  z-index: 50;
}

/* Small arrow */
.tier::before {
  content: "";
  position: absolute;
  bottom: 105%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(17, 24, 39, 0.95) transparent transparent transparent;

  opacity: 0;
  transition: 0.2s ease;
}

/* Show tooltip on hover */
.tier:hover::after,
.tier:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tier.empty::after,
.tier.empty::before {
    display: none;  /* hides the tooltip */
}

.tier-sign {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-weight: 900;
    font-size: 14px;
    border-radius: 6px;
    margin-left: auto;
    border: 1px solid rgba(255,255,255,0.25);
}

/* Colors */
.tier-sign.plus {
    color: #4ade80;
    border-color: #4ade80;
}

.tier-sign.minus {
    color: #f87171;
    border-color: #f87171;
}

/* PLAYER ROW */
.player-card {
    display: grid;
    align-items: center;
    padding: 16px 20px;
    background: rgba(255,255,255,0.03);
    grid-template-columns: 50px 50px 1fr auto;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    gap: 12px;
    justify-content: start;
    margin: 16px auto;
    transition: all 0.3s ease;
    width: calc(100% - 40px);
}

.player-card:hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.margin-top-playercount {
  margin: 10px;
  display: block;
}

.gold   { border-left: 6px solid #fbbf24; box-shadow: inset 0 0 20px rgba(14, 165, 233, 0.1); }
.silver { border-left: 6px solid #f5f5f5; box-shadow: inset 0 0 20px rgba(229, 231, 235, 0.1); }
.bronze { border-left: 6px solid #f97316; box-shadow: inset 0 0 20px rgba(249, 115, 22, 0.1); }

.rank {
    font-size: 24px;
    font-weight: 800;
    opacity: 0.95;
    text-align: center;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.1);
    object-fit: cover;
    transition: transform 0.3s ease;
}

.player-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #000;
    font-size: 16px;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.1);
}

.player-card:hover .avatar,
.player-card:hover .player-avatar {
    transform: scale(1.08);
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.player-name {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.player-sub {
    font-size: 13px;
    opacity: 0.65;
    font-weight: 500;
}

.region {
    width: 48px;
    text-align: center;
    padding: 6px 0;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    margin: 20px;
}

.region-na { background: #ef4444; }
.region-eu { background: #22c55e; }
.region-as { background: #7c22c5; }
.region-sa { background: #FF8AC4; }
.region-me { background: #FFBF00; }
.region-au { background: #4169E1; }
.region-af { background: #FF7518; }

/* ========================== */
/* POPUP MODAL - UPDATED UI   */
/* ========================== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: modalBgFadeIn 0.3s ease;
}

.modal.show {
    display: flex;
}
/* Outgoing friend request row: visually matches player rows but avoids player-row behaviors */
.outgoing-player-row {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255,255,255,0.04);
    border-left: 4px solid transparent;
    border-radius: 8px;
    gap: 15px;
    cursor: default;
    transition: all 0.3s ease;
}
.outgoing-player-row .player-name {
    font-weight: 700;
    color: rgba(255,255,255,0.95);
}

@keyframes modalBgFadeIn {
    from {
        background: rgba(0,0,0,0);
    }
    to {
        background: rgba(0,0,0,0.65);
    }
}

.modal-box {
    background: var(--gray2);
    padding: 28px 32px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    text-align: left;
    width: 380px;
    max-width: 90%;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-box button {
    display: block;
    margin: 20px auto 0 auto;
    padding: 12px 24px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    background: rgba(255,255,255,0.06);
    color: var(--text);
    transition: all 0.25s ease;
}

.modal-box button:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,255,255,0.08);
}

/* Rows inside modal */
.modal-section {
    margin-bottom: 16px;
    text-align: center;
}

.modal-info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.modal-label {
    font-weight: 600;
    color: rgba(255,255,255,0.6);
}

.modal-value {
    font-weight: 500;
    color: var(--text);
}

/* Subtitle before tiers */
.modal-subtitle {
    margin-top: 12px;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.modal-header {
  width: 100%;
  height: 150px;

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  border-radius: 14px;
  margin-bottom: 16px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 12px;

  position: relative;
  overflow: hidden;
}

/* Overlay */
.modal-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

/* Keep avatar & name visible */
.modal-header * {
  position: relative;
  z-index: 1;
}

.modal-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    object-fit: cover;
}

.modal-name {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
}

/* Tier container inside modal */
.tiers-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    height: 150px;
    overflow: auto;
    overflow-x: hidden;
}

/* DOCS SECTION */
.docs-section {
    margin: 60px auto;
    padding: 40px;
    width: 90%;
    max-width: 1000px;
    background: var(--gray);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-align: center;
    color: var(--text);
}

.tier-docs {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.tier-item {
    padding: 12px 16px;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: 0.25s;
    border: 1px solid var(--border);
    font-weight: 700;
}

.tier-item:hover {
    background: rgba(255,255,255,0.16);
}

.hidden-section { display: none; }
.active-section { display: block; }

/* ===================================== */
/* BUILDERS = PLAYER CARD STYLE OVERRIDE */
/* ===================================== */

/* Make builder cards behave exactly like player cards */
.builder-card {
  display: grid;
  grid-template-columns: 50px 50px 1fr 1fr 6fr;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  gap: 10px;
  margin: 6px 0;
  transition: all 0.3s ease;
  cursor: pointer;
}

.builder-card:hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.builder-card:hover .avatar {
  transform: scale(1.08);
}

/* Rank */
.builder-card .builder-rank {
  font-size: 22px;
  font-weight: 700;
  opacity: 0.9;
}

/* Avatar */
.builder-card .builder-avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: none;
  transition: transform 0.3s ease;
}

/* Info column */
.builder-card .builder-info {
  display: flex;
  flex-direction: column;
}

/* Name */
.builder-card .builder-name {
  font-size: 18px;
  font-weight: 700;
}

/* Subtitle */
.builder-card .builder-role,
.builder-card .builder-points {
  font-size: 14px;
  opacity: 0.75;
  background: none;
  padding: 0;
  border: none;
}

/* Region pill */
.builder-card .builder-region {
  width: 48px;
  text-align: center;
  padding: 5px 0;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  text-transform: uppercase;
}

/* Region colors */
.builder-region.na { background: #ef4444; }
.builder-region.eu { background: #22c55e; }
.builder-region.as { background: #7c22c5; }
.builder-region.sa { background: #FF8AC4; }
.builder-region.me { background: #FFBF00; }
.builder-region.au { background: #4169E1; }
.builder-region.af { background: #FF7518; }

/* Builders container spacing identical to leaderboard */
#builders-container {
  flex-direction: column;
  margin: 40px auto;
}

/* ======================== */
/* MOBILE & TABLET MEDIA CSS */
/* ======================== */

/* Breakpoint: Tablets and small screens */
@media (max-width: 1880px) {

    /* Navbar adjustments */
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 10px 16px;
        gap: 10px;
        align-items: flex-start;
        position: relative;
    }

    .nav-center {
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
    }

    .nav-center a,
    .dropdown-trigger {
        font-size: 14px;
        padding: 6px 10px;
    }

    .search-wrapper {
        width: 200px;
        justify-content: flex-start;
    }

    .searchbar {
        flex: 1;
    }

    /* Leaderboard adjustments */
    .table-header {
        display: none;
    }

    .player-card {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 16px;
        margin: 8px auto;
        gap: 8px;
        width: calc(100% - 32px);
    }

    .overall-tiers-display,
    .category-tiers-display {
        width: 100%;
        justify-content: flex-start;
    }

    .builder-card {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 16px;
        margin: 12px;
        gap: 8px;
    }

    .rank {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .player-avatar {
        width: 64px;
        height: 64px;
        margin-bottom: 6px;
    }

    .player-info {
        margin-bottom: 6px;
    }

    .tier-badge-small {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    /* Modal adjustments */
    .modal {
        display: none;
        align-items: flex-start;
        justify-content: center;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.55);
        z-index: 1000;
    }

    .modal.show {
        display: flex;
    }

    .modal-box {
        width: 90%;
        max-width: 400px;
        padding: 20px;
        margin: 0 auto;
        border-radius: 16px;
        border: 1px solid var(--border);
        background: var(--gray2);
        text-align: center;
    }

    .modal-box .tiers {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        overflow-x: auto;
    }

    .modal-box .tier img {
        width: 24px;
        height: 24px;
    }

    /* Mode leaderboard adjustments */
    .mode-tiers {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
    }

    .mode-tier-column {
        min-height: 200px;
        padding: 10px;
    }

    /* Docs section adjustments */
    .docs-section {
        padding: 16px;
        margin: 30px auto;
    }

    .tier-docs {
        align-items: center;
        gap: 8px;
    }

    .tier-item {
        width: 200px;
        max-width: 360px;
        text-align: center;
        margin-bottom: 6px;
    }

    /* Dropdown adjustments */
    .dropdown-container {
        width: auto;
        position: relative;
    }

    .dropdown-trigger {
        width: 140px;
        padding: 6px 10px;
        font-size: 14px;
        justify-content: space-between;
    }

    .dropdown-menu {
        min-width: 100%;
        max-width: 95vw;
        width: auto;
        padding: 8px;
        border-radius: 10px;
        flex-direction: column;
        box-sizing: border-box;
        display: none;
        z-index: 1003;
    }

    .dropdown-container.open .dropdown-menu {
        display: flex;
        opacity: 1;
    }

    .discord-btn {
        width: 100%;
        font-size: 14px;
        padding: 6px 10px;
    }
}

.header-container {
    display: flex;                    /* use flex */
    justify-content: center;          /* center content horizontally */
    align-items: center;              /* center content vertically */
    margin: 24px auto;                /* center element itself horizontally */

}

.header-message {
    width: 500px;
    font-size: 20px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05); /* subtle overlay */
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    opacity: 0.95;
    transition: 0.25s ease;          /* center content vertically */       
    text-align: center;       /* center element itself horizontally */
}

/* Optional hover effect */
.header-message:hover {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .header-message {
        text-align: center;          /* slightly smaller on small screens */
        font-size: 18px;
        padding: 10px 16px;
        margin-bottom: 16px;
    }

    .header-message {
    width: 200px;                     /* fixed width */
    font-size: 20px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05); /* subtle overlay */
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    opacity: 0.95;
    transition: 0.25s ease;

    display: flex;                    /* use flex */
    justify-content: center;          /* center content horizontally */
    align-items: center;              /* center content vertically */                /* center element itself horizontally */
}
}



/* Breakpoint: Small phones */
@media (max-width: 480px) {

    .nav-center a,
    .dropdown-trigger {
        font-size: 13px;
        padding: 5px 8px;
    }

    .avatar {
        width: 56px;
        height: 56px;
    }

    .rank {
        font-size: 16px;
    }

    .modal-box .tier img {
        width: 20px;
        height: 20px;
    }

    .modal-box {
        padding: 16px;
    }

    .dropdown-trigger {
        width: 120px;
        font-size: 13px;
    }

    .dropdown-menu {
        min-width: 100%;
        max-width: 95vw;
    }

    .discord-btn {
        font-size: 13px;
        padding: 5px 8px;
    }

    .player-card {
        padding: 10px 12px;
        margin: 32px 8px;
        gap: 6px;
    }

    .tiers {
        gap: 4px;
    }

    /* Mode leaderboard on small phones */
    .mode-tiers {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 8px;
    }

    .mode-tier-column {
        min-height: 180px;
        padding: 8px;
    }
}

/* MOBILE & TABLET FIXES FOR TIERS STACKING */
@media (max-width: 768px) {  /* tablets and smaller */
    .modal-box {
        margin: 16px;
    }

    /* Mode leaderboard columns should also shrink */
    .mode-tiers {
        grid-template-columns: 1fr; /* each column full width */
        gap: 12px;
    }

    .mode-tier-column {
        min-height: auto;       /* allow height to adjust */
        padding: 12px;
    }
}

/* Extra small phones */
@media (max-width: 480px) {
    .tiers {
        gap: 6px;
    }

    .modal-box .tiers {
        gap: 4px;
    }

    .mode-tiers {
        gap: 20px;
    }

    .mode-tier-column {
        padding: 8px;
    }

    /* Category Player Row - Stack vertically on phone */
    .category-player-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: center;
        gap: 16px;
        padding: 16px;
        border-radius: 16px;
    }

    .category-player-row:hover {
        transform: none;
    }

    .rank-player-section {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: auto !important;
        margin-right: inherit;
        border-radius: 12px;
    }

    .rank-badge {
        border-radius: 12px;
        padding: 0 20px;
        font-size: 32px;
        min-width: auto;
        margin-bottom: 8px;
    }

    .rank-avatar {
        width: 100px;
        height: 100px;
        margin-left: 0;
        border-radius: 12px;
        margin: auto !important;
    }

    .player-identity-section {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        width: 100%;
        text-align: center;
    }

    .player-info-section {
        margin: 0;
        align-items: center;
    }

    .player-info-section .player-name {
        font-size: 16px;
    }

    .region-section {
        width: 100%;
        min-width: auto;
    }

    .modes-section {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        min-width: inherit;
        margin: 0 !important;
    }
}

/* ===== OVERALL VIEW STYLES ===== */

.overall-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
}

#overall-players-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
}

@media (max-width: 768px) {
    .overall-container {
        grid-template-columns: 1fr;
        margin: auto !important;
    }

    .player-overview-card {
        padding: 12px;
    }

    .player-category-tiers {
        gap: 3px;
    }

    .tier-badge {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}

/* ===== CATEGORY OVERALL VIEW STYLES ===== */

.category-overall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    padding: 20px;
}

.category-player-card {
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.5) 0%, rgba(26, 40, 71, 0.4) 100%);
    border: 2px solid rgba(100, 116, 139, 0.4);
    border-radius: 10px;
    padding: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-player-card:hover {
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.7) 0%, rgba(26, 40, 71, 0.6) 100%);
    border-color: rgba(14, 165, 233, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.2);
}

.category-player-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(14, 165, 233, 0.2);
}

.category-tiers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.category-tier-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 45px;
    height: 45px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.category-tier-item:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.category-tier-item.tier-1 {
    background-color: #d97706;
    color: #000;
}

.category-tier-item.tier-2 {
    background-color: #9ca3af;
    color: #000;
}

.category-tier-item.tier-3 {
    background-color: #92472f;
    color: #fff;
}

.category-tier-item.tier-4 {
    background-color: #6b7280;
    color: #fff;
}

.category-tier-item.tier-5 {
    background-color: #78654d;
    color: #fff;
}

.category-tier-item.tier-unknown {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px dashed rgba(255, 255, 255, 0.3);
}

.mode-short {
    display: block;
    font-size: 9px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.category-tier-item .tier-icon {
    display: block;
    font-size: 14px;
    line-height: 1;
}

@media (max-width: 768px) {
    .player-card {
        grid-template-columns: 1fr;
        gap: 8px;
        width: calc(100% - 20px);
        margin: 8px 10px;
        padding: 12px 15px;
    }

    .rank {
        width: 100%;
        text-align: left;
        font-size: 14px;
    }

    .player-avatar {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }

    .player-info {
        width: 100%;
    }

    .overall-tiers-display,
    .category-tiers-display {
        width: 100%;
        flex-wrap: wrap;
    }

    .tier-category-group {
        flex-wrap: wrap;
    }

    .tier-badge-small {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .overall-container {
        padding: 10px;
        margin: auto !important;
    }

    #overall-players-list {
        padding: 0;
        gap: 6px;
    }

    /* Category Player Row responsive */
    .category-player-row {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 8px;
        margin: auto !important;
        border-radius: 8px;
        width: calc(100% - 16px);
        box-sizing: border-box;
        background: linear-gradient(135deg, rgba(30, 58, 95, 0.4) 0%, rgba(26, 40, 71, 0.2) 100%);
        border: 2px solid rgba(14, 165, 233, 0.08);
    }

    .rank-player-section {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
        flex-wrap: nowrap;
        margin-right: inherit;
        flex-direction: column !important;
    }

    .rank-badge {
        width: 50px;
        height: 50px;
        font-size: 24px;
        flex-shrink: 0;
        border-radius: 50%;
        min-width: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-top-left-radius: 16px;
        border-bottom-left-radius: 16px;
        border-top-right-radius: 16px;
        border-bottom-right-radius: 16px;
    }

    .player-identity-section {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 0px !important;
    }

    .player-info-section {
        min-width: 0;
    }

    .player-info-section .player-name {
        font-size: 14px;
        font-weight: 600;
        word-break: break-word;
        overflow-wrap: break-word;
        margin: 0;
    }

    .player-title {
        font-size: 11px;
        word-break: break-word;
        overflow-wrap: break-word;
        margin: 0;
    }

    .region-section {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.7);
        word-break: break-word;
        overflow-wrap: break-word;
        padding: 4px 8px;
        background: rgba(14, 165, 233, 0.15);
        border-radius: 4px;
        width: fit-content;
        margin-top: 4px;
    }

    .modes-section {
        display: flex;
        gap: 6px;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 6px 0;
        flex-wrap: wrap;
        justify-content: flex-start;
        margin: 0 !important;
    }

    .mode-item {
        flex-shrink: 0;
        min-width: 50px;
        max-width: 60px;
    }

    .mode-item .mode-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 14px;
    }

    .tier-badge-rounded {
        width: 20px;
        height: 20px;
        font-size: 9px;
        bottom: -4px;
        padding: 2px 3px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .tier-badge-rounded.tier-retired {
        background: #000 !important;
        color: #fff !important;
        border: 1px solid #fff;
    }
    
    .player-name.nitro {
        background: linear-gradient(90deg, #8b5cf6, #3b82f6, #8b5cf6);
        background-size: 200% 200%;
        animation: nitro-gradient 3s ease infinite;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .tier-header {
        margin-bottom: 12px;
        padding-bottom: 10px;
        gap: 8px;
    }

    .tier-icon {
        font-size: 20px;
    }

    .tier-title {
        font-size: 16px;
    }

    .tier-count {
        font-size: 12px;
    }
}

/* Overall and Category Tier Badges */
.overall-tiers-display,
.category-tiers-display {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    align-items: center;
}

.tier-category-group {
    display: flex;
    gap: 4px;
}

.tier-badge-small {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.tier-badge-small:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tier-badge-small.tier-1 {
    background-color: #d97706;
    color: #000;
}

.tier-badge-small.tier-2 {
    background-color: #9ca3af;
    color: #000;
}

.tier-badge-small.tier-3 {
    background-color: #92472f;
    color: #fff;
}

.tier-badge-small.tier-4 {
    background-color: #6b7280;
    color: #fff;
}

.tier-badge-small.tier-5 {
    background-color: #78654d;
    color: #fff;
}

.tier-badge-small.tier-unknown {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.5);
}

/* Update overall-players-list to match leaderboard styling */
#overall-players-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
}

/* Category Player Row Layout */
.category-player-row {
    display: grid;
    grid-template-columns: auto 1fr minmax(280px, 1fr);
    gap: 24px;
    align-items: center;
    padding: 24px 28px;
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.4) 0%, rgba(26, 40, 71, 0.2) 100%);
    border: 2px solid rgba(14, 165, 233, 0.15);
    border-radius: 16px;
    margin: 0 0 16px 0;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    overflow: visible;
    position: relative;
}

.category-player-row:hover {
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.6) 0%, rgba(26, 40, 71, 0.4) 100%);
    border-color: rgba(14, 165, 233, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(14, 165, 233, 0.15);
}

.rank-player-section {
    display: flex;
    align-items: center;
    position: relative;
    overflow: visible;
    border-radius: 12px 0 0 12px;
    clip-path: none;
    flex-shrink: 0;
    height: auto;
    min-height: 100px;
    width: auto;
    margin-right: -40px;
    z-index: 3;
}

.rank-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 36px;
    font-size: 56px;
    font-weight: 900;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: #000;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.4);
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    letter-spacing: -2px;
    min-width: 110px;
    flex-shrink: 0;
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
}

.rank-badge.gold {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
    box-shadow: 0 4px 16px rgba(251, 191, 36, 0.4);
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.rank-badge.silver {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    color: #000;
    box-shadow: 0 4px 16px rgba(192, 192, 192, 0.4);
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #000;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.4);
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.rank-avatar {
    width: 140px;
    height: 140px;
    margin-left: -50px;
    z-index: 2;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.player-identity-section {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.player-info-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    margin: 30px;
    overflow: hidden;
}

.player-avatar {
    width: 100%;
    height: 100%;
    border-radius: 0;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    box-shadow: none;
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.player-info-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.player-info-section .player-name {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.player-title {
    font-size: 15px;
    color: #f59e0b;
    font-weight: 500;
}

.region-section {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    padding: 6px 10px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(14, 165, 233, 0.05) 100%);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 8px;
    text-align: center;
    min-width: 65px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    white-space: nowrap;
}

.modes-section {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
    overflow: auto;
    min-width: 280px;
    max-width: 100%;
}

.mode-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    background: transparent;
    border: none;
}

.mode-item:hover {
    transform: scale(1.1);
}

.mode-icon {
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Custom peak tooltip that appears above mode icons */
.mode-peak-tooltip {
    background: #1e3a5f;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
    box-shadow: 0 6px 20px rgba(2,6,23,0.6);
    transform: translateY(-4px);
    position: fixed; /* ensure pseudo-element anchors correctly */
    overflow: visible;
    z-index: 99999;
}
.mode-peak-tooltip::after {
    /* small triangle pointing down (arrow toward the mode) */
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 100%;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #1e3a5f;
    z-index: 99999;
}

/* Make modal mode icons interactive like row icons */
.player-modal-tier-icon {
    width: 32px;
    height: 32px;
    display: inline-block;
    object-fit: contain;
    transition: transform 0.12s ease;
    cursor: pointer;
}
.player-modal-tier-icon:hover {
    transform: scale(1.1);
}

/* modal tier badge should also scale slightly on hover */
.player-modal-tier-badge {
    transition: transform 0.12s ease;
    display: inline-block;
}
.player-modal-tier-badge:hover {
    transform: scale(1.08);
}

/* hovered class used by JS to sync icon/badge hover state */
.mode-icon.hovered,
.player-modal-tier-icon.hovered {
    transform: scale(1.12) !important;
}
.player-modal-tier-badge.hovered,
.tier-badge-rounded.hovered,
.tier-badge-small.hovered {
    transform: scale(1.08) !important;
}

.tier-badge-rounded {
    position: absolute;
    bottom: -6px;
    width: 40px;
    height: 22px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    border: 2px solid rgba(15, 23, 42, 0.95);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.tier-badge-rounded.tier-1 {
    background-color: #d97706;
    color: #fff;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.4);
}

.tier-badge-rounded.tier-2 {
    background-color: #9ca3af;
    color: #fff;
    box-shadow: 0 2px 6px rgba(156, 163, 175, 0.4);
}

.tier-badge-rounded.tier-3 {
    background-color: #92472f;
    color: #fff;
    box-shadow: 0 2px 6px rgba(146, 71, 47, 0.4);
}

.tier-badge-rounded.tier-4 {
    background-color: #6b7280;
    color: #fff;
    box-shadow: 0 2px 6px rgba(107, 114, 128, 0.4);
}

.tier-badge-rounded.tier-5 {
    background-color: #78654d;
    color: #fff;
    box-shadow: 0 2px 6px rgba(120, 101, 77, 0.4);
}

.tier-badge-rounded.tier-unknown {
    background-color: #6b7280;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* ========================================
   LOGIN & PROFILE SECTION
======================================== */

.profile-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    min-height: auto;
}

/* Login Prompt */
.login-prompt {
    width: 100%;
    max-width: 350px;
    cursor: pointer;
    justify-content: center;
}

.login-prompt-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(14, 165, 233, 0.15);
    border: 1px solid rgba(14, 165, 233, 0.4);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 13px;
    white-space: nowrap;
}

.login-prompt-content:hover {
    background: rgba(14, 165, 233, 0.25);
    border-color: rgba(14, 165, 233, 0.6);
    transform: translateY(-1px);
}

.login-prompt-content i {
    font-size: 16px;
    color: #0ea5e9;
}

.login-prompt-content span {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 500;
}

/* User Profile */
.user-profile {
    width: 100%;
    max-width: 420px;
}

.profile-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
}

.profile-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.profile-ign {
    color: rgba(255, 255, 255, 0.95);
    font-size: 13px;
    font-weight: 700;
    padding: 3px 8px;
    background: rgba(34, 197, 94, 0.2);
    border-radius: 4px;
}

.profile-actions {
    display: flex;
    gap: 6px;
}

.profile-btn {
    padding: 5px 11px;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-edit {
    background: rgba(14, 165, 233, 0.25);
    color: #0ea5e9;
    border: 1px solid rgba(14, 165, 233, 0.4);
}

.profile-edit:hover {
    background: rgba(14, 165, 233, 0.4);
    border-color: rgba(14, 165, 233, 0.6);
}

.profile-logout {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.profile-logout:hover {
    background: rgba(239, 68, 68, 0.35);
    border-color: rgba(239, 68, 68, 0.6);
}

/* Edit Profile Sections */
.edit-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(14, 165, 233, 0.15);
}

.edit-section:last-of-type {
    border-bottom: none;
}

.edit-section h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.edit-description {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 16px;
}

/* Banner Grid */
.banner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 6px;
}

.banner-option {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(14, 165, 233, 0.2);
    transition: all 0.2s ease;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
}

.banner-option:hover {
    border-color: rgba(14, 165, 233, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.25);
}

.banner-option.selected {
    border-color: #0ea5e9;
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.6), inset 0 0 16px rgba(14, 165, 233, 0.25);
}

.banner-option::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease;
}

.banner-option:hover::after {
    background: rgba(0, 0, 0, 0.2);
}

.banner-option.selected::after {
    background: rgba(14, 165, 233, 0.2);
}

.banner-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
}

/* Login Modal */
.login-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-modal-content {
    background: linear-gradient(135deg, #0f172a 0%, #1a2942 100%);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 12px;
    padding: 32px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.login-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.login-modal-header h2 {
    color: #fff;
    font-size: 22px;
    margin: 0;
}

.login-modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.login-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(14, 165, 233, 0.5);
}

.login-modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-info-box {
    background: rgba(14, 165, 233, 0.15);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 8px;
    padding: 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.login-info-box p {
    margin: 0 0 8px 0;
}

.login-info-box p:last-child {
    margin: 0;
}

.login-info-box strong {
    color: rgba(255, 255, 255, 0.95);
}

.login-info-box code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #0ea5e9;
}

.login-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-form-group label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 600;
}

.login-form-group small {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

.login-form-group input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 6px;
    padding: 10px 12px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.login-form-group input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(14, 165, 233, 0.6);
    box-shadow: 0 0 8px rgba(14, 165, 233, 0.2);
}

.login-form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.login-form-group input[readonly] {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    cursor: not-allowed;
}

.login-submit-btn {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: #fff;
    border: none;
    padding: 11px 18px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 6px;
}

.login-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
}

.login-submit-btn:active {
    transform: translateY(0);
}

.login-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
}

/* Player Search Styles */
.search-container {
    position: relative;
    width: 300px;
    flex-shrink: 0;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(14, 165, 233, 0.1);
    border: 2px solid rgba(14, 165, 233, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.2s ease;
    gap: 8px;
    position: relative;
    flex: 1 1 auto;
    min-width: 220px;
}

.search-input-wrapper:focus-within {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.6);
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.2);
}

.search-icon {
    color: rgba(14, 165, 233, 0.6);
    font-size: 14px;
    flex-shrink: 0;
}

.player-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 14px;
    width: 100%;
    padding: 0;
}

.player-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.98) 0%, rgba(26, 40, 71, 0.98) 100%);
    border: 2px solid rgba(14, 165, 233, 0.3);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(14, 165, 233, 0.2);
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.search-result-item:hover {
    background: rgba(14, 165, 233, 0.2);
}

.search-result-item:active {
    background: rgba(14, 165, 233, 0.3);
}

.search-result-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid rgba(14, 165, 233, 0.4);
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.search-result-name {
    color: #fff;
    font-weight: 500;
    font-size: 14px;
}

.search-result-region {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.search-result-category {
    color: #0ea5e9;
    font-size: 12px;
    font-weight: 600;
}

.search-no-results {
    padding: 16px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

/* Responsive search */
@media (max-width: 1024px) {
    .search-container {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .search-container {
        display: none;
    }
}

/* Mobile optimization for tabs scrolling */
@media (max-width: 480px) {
    .tier-card {
        border-radius: 8px;
    }

    .tier-card .tier-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .tier-card .tier-item {
        padding: 10px 8px;
    }

    .tier-prefix {
        font-size: 10px;
        padding: 2px 4px;
    }

    .tier-count-badge {
        font-size: 12px;
        padding: 4px 8px;
    }
}

/* ============================= */
/* WhatsApp-like chat refinements */
/* ============================= */
/* Chat layout using UltraTiers palette (match tierlist styling) */
.chat-navbar { display:flex; align-items:center; padding:12px 40px; border-bottom:1px solid var(--border-color); background: linear-gradient(180deg, rgba(26, 40, 71, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%); border-bottom: 2px solid rgba(14, 165, 233, 0.2); }
.chat-navbar .chat-logo { display:flex; align-items:center; gap:12px; cursor:pointer; }
.chat-navbar .chat-logo .logo { height:45px; width:auto; border-radius:12px; }
.chat-navbar .chat-logo h1 { font-size:26px; color:var(--accent); margin:0; font-weight:800; letter-spacing:1px; }

.chat-app { background: transparent; }
.chat-sidebar { border: 1px solid var(--border-color); background: var(--bg-card); }
.friends-list-items div, .incoming-list div, .outgoing-list div { background: rgba(255,255,255,0.02); }
.friends-list-items div:hover, .incoming-list div:hover, .outgoing-list div:hover { background: transparent; }
.friends-list-items div, .incoming-list div, .outgoing-list div { display:flex; align-items:center; gap:10px; }
.friends-list-items div span, .incoming-list div span, .outgoing-list div span { font-weight:600; color:var(--text-primary); }

.chat-window { position:relative; }
.chat-header { position:sticky; top:0; z-index:5; display:flex; align-items:center; gap:12px; padding:12px 16px; background: transparent; border-bottom:1px solid var(--border-color); }
.chat-body { background: transparent; padding:20px; }

/* Message bubbles use subtle cards and tierlist colors */
.msg { position:relative; }
.msg .bubble-text { display:block; width:100%; white-space:pre-wrap; word-wrap:break-word; color:var(--text-primary); overflow-wrap:anywhere; word-break:break-all; }
.msg.me { background: rgba(14,165,233,0.06); color: #000; }
.msg.them { background: rgba(255,255,255,0.02); color: var(--text-primary); }

.chat-input-area { align-items:center; }
.chat-input-area input, .chat-input-area textarea { background: rgba(255,255,255,0.03); color: var(--text-primary); border:1px solid var(--border-color); }
.chat-input-area .send-btn { background: var(--accent); color:#000; box-shadow: 0 6px 12px rgba(14,165,233,0.12); }
.chat-input-area .send-btn:active { transform:translateY(1px); }

/* small screens: full screen chat */
@media (max-width: 800px) {
    .chat-app { padding:8px; }
    .chat-window { width:100%; }
    .chat-body { padding:12px; }
    .msg { max-width:85%; }
}

/* floating send icon styles */
.chat-input-area { position: relative; display:flex; align-items:center; gap:12px; padding:12px 18px; }
.chat-input-area input, .chat-input-area textarea { flex:1; width:100%; padding:12px 110px 12px 14px; border-radius:8px; border:1px solid rgba(0,0,0,0.06); box-sizing:border-box; resize:none; }
.chat-input-area textarea { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.chat-input-area .send-btn {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    width:40px;
    height:40px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:14px;
    border:none;
    opacity: 0.9;
    background: linear-gradient(90deg,#25D366,#128C7E);
    color: #fff;
    transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}
.chat-input-area .send-btn.active { transform: translateY(-50%) scale(1.03); box-shadow: 0 6px 18px rgba(18,140,126,0.22); }

/* avatars in lists/header */
.chat-user-avatar { border-radius:8px; margin-right:10px; }
.avatar { width:36px; height:36px; border-radius:8px; object-fit:cover; margin-right:10px; }
.friend-row, .incoming-row { display:flex; align-items:center; gap:10px; padding:4px; }


/* ============================= */
/* Polished WhatsApp-like/chat final styles */
/* ============================= */
/* Clone header on chat page */
#chat-header-clone {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    /* don't force a green background here — keep the original header appearance */
    background: transparent;
    color: inherit;
    box-shadow: 0 6px 20px rgba(2,6,23,0.6);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
#chat-header-clone .header-content { width:100%; display:flex; align-items:center; gap:12px; }
#chat-header-clone .logo-section { display:flex; align-items:center; gap:10px; }
#chat-header-clone .logo { width:36px; height:36px; }
#chat-header-clone .profile-section { margin-left:auto; }
#chat-header-clone .searchbar-row { display:none; }

/* cloned header is sticky and flows above the chat app */

/* Chat app full-bleed container */
.chat-app { margin: 24px; display:flex; gap:18px; }

/* Prevent chat layout from growing horizontally due to long unbroken text */
.chat-app, .chat-window, .chat-body {
    overflow-x: hidden;
    min-width: 0;
}

/* Sidebar and window layout for WhatsApp-like look */
.chat-sidebar {
    width:320px;
    min-width:260px;
    max-width:34%;
    border-radius:12px;
    background: linear-gradient(180deg, rgba(26, 40, 71, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 2px solid rgba(14, 165, 233, 0.2);
    height: 750px;
    display: flex;
    flex-direction: column;
}
.chat-window {
    flex:1;
    display:flex;
    flex-direction:column;
    border-radius:12px;
    background: linear-gradient(180deg, rgba(26, 40, 71, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 2px solid rgba(14, 165, 233, 0.2);
    height: 750px;
}
.chat-body { flex:1; overflow:auto; padding:22px; }

/* Message bubble layout */
.msg { display:block; max-width:64%; margin:8px 0; word-break: break-all; overflow-wrap: anywhere; }
.msg.me { margin-left: auto; text-align:right; }
.msg.them { margin-right: auto; text-align:left; }

/* Sidebar refinements */
.chat-sidebar { padding:14px; }
.friend-add input { background: transparent; border:1px solid var(--border-color); color: var(--text-primary); }
.friend-add .add-btn { font-size:20px; }
.friends-list-items div, .incoming-list div, .outgoing-list div { padding:6px; background:transparent; border-radius:10px; }
.friends-list-items div .avatar, .incoming-list div .avatar, .outgoing-list div .avatar { width:36px; height:36px; border-radius:50%; background:#0b2730; flex-shrink:0; }
.friends-list-items div .meta,
.incoming-list div .meta,
.outgoing-list div .meta { display:flex; flex-direction:row; align-items:center; gap:8px; }
.friends-list-items div .meta .name,
.incoming-list div .meta .name,
.outgoing-list div .meta .name { color:#e9f6f0; font-weight:400; }
.friends-list-items div .meta .sub,
.incoming-list div .meta .sub,
.outgoing-list div .meta .sub { color:#98a6ad; font-size:12px; }

/* Ensure the textual stack (name + sub) inside meta is vertically centered */
.friends-list-items div .meta > div,
.incoming-list div .meta > div,
.outgoing-list div .meta > div {
    align-items: center;
}

/* Chat window refinements */
.chat-header { display:flex; align-items:center; gap:12px; padding:12px 16px; }
.chat-header .back-btn { background:transparent; border:none; color:#fff; font-size:20px; cursor:pointer; }
.chat-body { background-image: url(''); background-size:cover; background-repeat:no-repeat; padding:22px; }

/* Message bubble improvements */
.msg { padding:10px 12px; border-radius:16px; box-shadow: 0 4px 12px rgba(2,6,23,0.08); }
.msg.me { background: rgba(14,165,233,0.06); color: var(--text-primary); }
.msg.them { background: rgba(255,255,255,0.02); color: var(--text-primary); }
.msg small { color: lightslategray; font-size:11px; display:block; margin-top:6px; }

/* Tail cleanup for small screens */
.msg.me::after, .msg.them::after { display:none; }

/* Sticky input area */
.chat-input-area { background: transparent; border-top:1px solid var(--border-color); padding:14px; }
.chat-input-area input, .chat-input-area textarea { background: rgba(255,255,255,0.02); color: var(--text-primary); box-shadow: none; }

/* pleasant scrollbar for chat body */
.chat-body::-webkit-scrollbar { width:10px; }
.chat-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius:10px; }

@media (max-width: 900px) {
    #chat-header-clone { padding:8px 12px; }
    body #ultratier-chat-app { padding-top:64px; }
    .chat-app { margin: 8px; }
}

/* Overrides and improvements for chat layout */
.friend-add { display:flex; gap:8px; align-items:center; margin-bottom:14px; }
.friend-add input { flex:1; padding:10px 12px; border-radius:8px; color:#eaf6f2; border:1px solid rgba(255,255,255,0.03); background:rgba(255,255,255,0.02); }
.friend-add .add-btn { width:36px; height:36px; border-radius:8px; background: var(--accent); color:#000; border:none; cursor:pointer; }

.friends-list-items .friend-row,
.incoming-list .incoming-row,
.outgoing-list .outgoing-row { display:flex; align-items:center; gap:12px; padding:4px 6px; border-radius:8px; cursor:pointer; border: 2px solid rgba(14,165,233,0.06); background: linear-gradient(180deg, rgba(26, 40, 71, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%); min-height:56px; margin-bottom:8px; }
/* remove hover animation / visual change inside lists */
.friends-list-items .friend-row:hover,
.incoming-list .incoming-row:hover,
.outgoing-list .outgoing-row:hover { background: linear-gradient(180deg, rgba(26, 40, 71, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%) !important; }
.friends-list-items .friend-row .avatar,
.incoming-list .incoming-row .avatar,
.outgoing-list .outgoing-row .avatar { width:40px; height:40px; border-radius:50%; }
.friends-list-items .friend-row .meta .name,
.incoming-list .incoming-row .meta .name,
.outgoing-list .outgoing-row .meta .name { font-size:14px; }

/* Ensure any inner <strong> doesn't force bold and can be truncated */
.friends-list-items .friend-row .meta .name strong,
.incoming-list .incoming-row .meta .name strong,
.outgoing-list .outgoing-row .meta .name strong {
    font-weight: inherit;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* Hide the secondary sub-label for outgoing requests (we only show the name) */
.outgoing-list .sub { display: none; }

/* Add bottom padding to section headings in the chat sidebar */
.chat-sidebar .sidebar-section h4 { padding-bottom: 8px; margin: 8px 0 6px 0; }

/* make sidebar lists scrollable when content exceeds available space */
.incoming-list, .outgoing-list, .friends-list-items {
    overflow:auto;
    max-height: 300px;
}

.no-convo { text-align:center; color:rgba(255,255,255,0.5); font-size:16px; margin-top:32px; }

/* When chat body is in no-conversation mode, hide existing messages visually */
.chat-body.no-convo-active > .msg { display: none !important; }
.chat-body.no-convo-active { position: relative; }
.chat-body.no-convo-active .no-convo { display: block; }

/* Incoming requests placeholder */
.no-requests { text-align:left; color:rgba(255,255,255,0.55); font-size:13px; padding:6px 4px; }

/* No friends placeholder */
.no-friends { text-align:left; color: var(--text-secondary); font-size:13px; padding:6px 4px; }

/* Actions menu (three dots) */
.three-dots-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
}
.three-dots-btn:hover { background: transparent; }
.dropdown-menu {
    position: absolute;
    right: 0;
    top: 36px;
    background: var(--bg-card);
    border: 1px solid rgba(14,165,233,0.12);
    box-shadow: 0 6px 18px rgba(2,6,23,0.6);
    border-radius: 8px;
    overflow: hidden;
    min-width: 120px;
    z-index: 1000;
}
.dropdown-item { padding: 8px 12px; color: var(--text-primary); }
.dropdown-item:hover { background: transparent; }

/* Incoming accept/decline icons */
.accept-icon, .decline-icon, .cancel-icon {
    background: transparent;
    border: none;
    font-size: 14px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
}
.accept-icon { color: var(--accent); }
.decline-icon, .cancel-icon { color: #ff6b6b; }
.accept-icon:hover, .decline-icon:hover, .cancel-icon:hover { background: transparent; }

/* Ensure meta and children never show hover backgrounds */
.friends-list-items .friend-row .meta,
.incoming-list .incoming-row .meta,
.outgoing-list .outgoing-row .meta,
.friends-list-items .friend-row .meta *,
.incoming-list .incoming-row .meta *,
.outgoing-list .outgoing-row .meta * {
    background: transparent !important;
}

/* center-align meta children and disable hover on inner divs */
.friends-list-items .friend-row .meta {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
}
.friends-list-items .friend-row .meta div:hover,
.friends-list-items .friend-row .meta *:hover {
    background: transparent !important;
    transform: none !important;
}

/* Allow the text column to shrink so long names can truncate with ellipsis */
.friends-list-items .friend-row .meta > div,
.incoming-list .incoming-row .meta > div,
.outgoing-list .outgoing-row .meta > div {
    min-width: 0;
    flex: 1 1 0;
}

/* Truncate long names with an ellipsis in the left sidebar cards */
.friends-list-items .friend-row .meta .name,
.incoming-list .incoming-row .meta .name,
.outgoing-list .outgoing-row .meta .name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 12ch; /* show ... after ~12 characters */
}

/* Confirm modal (used for friend remove) */
.confirm-modal-overlay {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    z-index: 20000;
}
.confirm-modal {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 18px;
    min-width: 320px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    border: 2px solid rgba(14,165,233,0.08);
    color: var(--text-primary);
}
.modal-cancel-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}
.modal-remove-btn {
    background: linear-gradient(90deg,#ff7b7b,#ff4d4d);
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

/* Outgoing list tweaks */
.outgoing-list .outgoing-row, .incoming-list .incoming-row { display:flex; align-items:center; gap:10px; border-radius:8px; }
.outgoing-list .outgoing-row .avatar { width:36px; height:36px; border-radius:50%; }
.outgoing-list .outgoing-row .cancel-icon { margin-left:8px; }

.chat-input-area { position: relative; display:flex; align-items:center; gap:12px; padding:12px 18px; }
.chat-input-area input, .chat-input-area textarea { flex:1; width:100%; padding:12px 110px 12px 14px; border-radius:8px; border:1px solid rgba(0,0,0,0.06); box-sizing:border-box; resize:none; }
.chat-input-area .send-btn { margin-left:8px; min-width:86px; height:40px; border-radius:20px; display:flex; align-items:center; justify-content:center; font-size:14px; border:none; background: var(--accent); color:#000; cursor:pointer; }
.chat-input-area .send-btn:disabled { opacity:0.5; cursor:default; }

/* Friend list action buttons */
.chat-open-btn, .chat-remove-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.06);
    color: #eaf6f2;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
}
.chat-open-btn:hover { background: rgba(255,255,255,0.02); }
.chat-remove-btn { background: linear-gradient(90deg,#ff7b7b,#ff4d4d); border-color: rgba(255,255,255,0.04); }
.chat-remove-btn:hover { filter: brightness(0.95); }

/* make sure chat messages area has comfortable padding and anchors to top */
.chat-body { padding:20px 28px; display:flex; flex-direction:column; }
.chat-body .msg { margin-bottom:12px; }

/* Mobile: stack chat sidebar above the chat window and make input layout friendly */
@media (max-width: 768px) {
    .chat-app { flex-direction: column; margin: 12px; gap: 12px; }
    .chat-sidebar, .chat-window { width: 100%; max-width: none; min-width: 0; height: auto; }
    .chat-sidebar { order: 0; }
    .chat-window { order: 1; }
    .chat-window, .chat-sidebar { border-radius: 12px; }
    .chat-body { padding: 12px; height: 50vh; overflow:auto; }

    /* Input: make send button inline and avoid absolute positioning */
    .chat-input-area { padding: 10px; }
    .chat-input-area .send-btn { position: static; right: auto; top: auto; transform: none; width: auto; height:40px; border-radius:8px; margin-left:8px; }
    .chat-input-area input, .chat-input-area textarea { padding: 10px 14px; }
    .chat-input-area textarea { min-height:48px; max-height:140px; resize:vertical; overflow:auto; }

    /* Sidebar compacting */
    .chat-sidebar { padding: 10px; }
    .friends-list-items .friend-row,
    .incoming-list .incoming-row,
    .outgoing-list .outgoing-row { padding: 8px; min-height:48px; }

    /* Ensure message bubbles take full width on mobile */
    .msg { max-width: 100%; }
}

