@charset "UTF-8";

:root {
    --background: #10161d;
    --card: #121822;
    --card-hover: #1a2332;
    --border: #18202a;
    --border-light: #1e2939;
    --foreground: #f9fafb;
    --muted: #6a7282;
    --muted-foreground: #99a1af;
    --accent: #1e2939;
    --accent-foreground: #f9fafb;
    --ht1: #6d5d2c;
    --ht1-foreground: #e8ba3a;
    --lt1: #584c25;
    --lt1-foreground: #d5b355;
    --ht2: #5e6979;
    --ht2-foreground: #c4d3e7;
    --lt2: #4a505a;
    --lt2-foreground: #a0a7b2;
    --ht3: #6b4b36;
    --ht3-foreground: #f89f5a;
    --lt3: #593722;
    --lt3-foreground: #c67b42;
    --ht4: #303144;
    --ht4-foreground: #81749a;
    --lt4: #2c2e40;
    --lt4-foreground: #655b79;
    --ht5: #2b2c3d;
    --ht5-foreground: #8f82a8;
    --lt5: #262a3a;
    --lt5-foreground: #655b79;
    --radius: 0.6rem;
    --radius-lg: 0.9rem;
    --max-width: 1500px;
    --layout-sections-color: #121822;
    --layout-item-outline: #18202a;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

button {
    background: none;
    border: 0;
    color: inherit;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
    background-color: var(--background);
}

::-webkit-scrollbar-thumb {
    background-color: #869aaf;
    border-radius: 100rem;
}

.layout {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-space {
    padding-top: 1.75rem;
}

.header {
    max-width: var(--max-width);
    height: 64px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    background: var(--layout-sections-color);
    border: 2px solid var(--layout-item-outline);
    position: fixed;
    top: 1.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2.5rem);
    z-index: 100;
}

.nav-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 0 1.25rem;
}

.nav-logo a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--foreground);
    font-weight: 700;
    font-size: 1.15rem;
}

.nav-logo img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.3rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    color: var(--muted-foreground);
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--foreground);
    background: var(--accent);
}

.nav-link svg {
    width: 22px;
    height: 22px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(155, 187, 245, 0.15);
    border-radius: 100px;
    padding: 0.5rem 0.85rem;
    color: var(--muted-foreground);
}

.search-box svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--foreground);
    width: 140px;
}

.search-box input::placeholder {
    color: var(--muted-foreground);
}

.search-box kbd {
    background: var(--accent);
    color: var(--muted-foreground);
    padding: 0.25rem 0.5rem;
    border-radius: 0.35rem;
    font-size: 0.8rem;
}

.discord-btn,
.mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
}

.discord-btn {
    background: #5865f2;
    color: #fff;
}

.discord-btn:hover {
    background: #4752c4;
}

.mobile-menu-btn {
    display: none;
    color: var(--muted-foreground);
    cursor: pointer;
}

.main-content {
    max-width: var(--max-width);
    width: 100%;
    min-height: calc(100vh - 200px);
    margin: 0 auto;
    padding: 6.75rem 1.25rem 2rem;
}

.content-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 1rem;
    padding: 1rem;
}

.mode-tabs {
    position: relative;
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 0.6rem;
    margin-bottom: 1rem;
}

.mode-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 1rem;
    border-radius: 0.8rem;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    white-space: nowrap;
}

.mode-tab:hover,
.mode-tab.active {
    color: var(--foreground);
    background: rgba(255, 255, 255, 0.03);
}

.mode-tab img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.mode-tab-indicator {
    position: absolute;
    bottom: -2px;
    height: 2px;
    background: #fff;
    transition: left 0.35s cubic-bezier(.4, 0, .2, 1), width 0.35s cubic-bezier(.4, 0, .2, 1);
    z-index: 5;
    border-radius: 2px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.stats-box {
    display: flex;
    gap: 0.75rem;
}

.stat-item {
    min-width: 96px;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
}

.stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
}

.stat-label {
    display: block;
    color: var(--muted-foreground);
    font-size: 0.8rem;
}

.server-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.server-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.server-label {
    display: block;
    color: var(--muted-foreground);
    font-size: 0.72rem;
    font-weight: 700;
}

.ip-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
}

.leaderboard-header {
    display: none;
}

.leaderboard-list,
#leaderboardList {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.leaderboard-item {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    background: rgba(30, 41, 57, 0.2);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 78px;
    overflow: visible;
    position: relative;
    z-index: 1;
}

.leaderboard-item:hover {
    background: var(--accent);
    border-color: var(--border-light);
    transform: translateX(-4px);
    z-index: 50;
}

.lb-shimmer-area {
    position: relative;
    width: 160px;
    min-height: 78px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.lb-shimmer-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lb-rank-num {
    position: absolute;
    bottom: 0.1rem;
    left: 0.6rem;
    font-size: 2rem;
    font-weight: 800;
    font-style: italic;
    z-index: 2;
    color: var(--foreground);
    text-shadow: 0 3px 1px #232323;
    line-height: 1;
}

.lb-bust {
    position: absolute;
    right: 0.75rem;
    bottom: 0;
    height: 65px;
    width: auto;
    z-index: 1;
    filter: drop-shadow(-4px -2px 1px rgba(0, 0, 0, 0.47));
}

.lb-player-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    min-width: 0;
    width: 220px;
    flex-shrink: 0;
}

.lb-pname {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--foreground);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-ptitle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    line-height: 1.4;
}

.lb-title-icon,
.profile-title-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.lb-ptitle-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.lb-ptitle-pts {
    color: var(--muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

.title-grandmaster { color: var(--ht1-foreground); }
.title-master { color: var(--lt1-foreground); }
.title-ace { color: var(--ht2-foreground); }
.title-specialist { color: var(--lt2-foreground); }
.title-cadet { color: var(--ht3-foreground); }
.title-rookie { color: var(--lt5-foreground); }

.lb-region {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    padding: 0 0.75rem;
}

.lb-continent,
.lb-country {
    color: var(--muted-foreground);
    white-space: nowrap;
}

.lb-continent {
    font-size: 0.7rem;
    font-weight: 600;
}

.lb-country {
    font-size: 0.65rem;
    opacity: 0.75;
}

.lb-tier-slots {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.35rem 1rem;
    min-width: 0;
}

.tier-slot {
    position: relative;
    width: 40px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 4px;
}

.tier-slot-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 5px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tier-slot-circle:hover {
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

.tier-slot-circle img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.tier-slot-label {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    padding: 1px 4px;
    border-radius: 0.35rem;
    text-align: center;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.3;
}

.tier-slot-elo {
    font-size: 0.55rem;
    display: block;
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.tier-slot-tooltip {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 999;
    white-space: nowrap;
}

.tier-slot:hover .tier-slot-tooltip {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.tier-tooltip-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.45rem 0.7rem;
    border-radius: var(--radius);
    border: 2px solid;
    background: var(--card);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    min-width: 70px;
    position: relative;
}

.tier-tooltip-name {
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1.2;
}

.tier-tooltip-pts {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted-foreground);
}

.tier-slot-circle.tier-empty {
    border: 2px dashed var(--muted);
    background: transparent;
    opacity: 0.3;
}

.tier-slot-label.tier-empty-label {
    background: transparent !important;
    color: var(--muted) !important;
    opacity: 0.4;
    font-size: 0.55rem;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.modal-content {
    position: relative;
    width: min(960px, 100%);
    max-height: calc(100vh - 2rem);
    overflow: auto;
    background: var(--card);
    border: 2px solid var(--border-light);
    border-radius: 1rem;
    padding: 1.25rem;
    z-index: 1;
}

.modal-close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    cursor: pointer;
    color: var(--muted-foreground);
}

.profile-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 120px;
    height: 160px;
    object-fit: contain;
    flex-shrink: 0;
}

.profile-name {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.profile-title-row,
.profile-stats-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.profile-title-pts,
.profile-tiers-note,
.profile-stat-label {
    color: var(--muted-foreground);
}

.profile-stats-row {
    margin-top: 1rem;
}

.profile-stat {
    min-width: 130px;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
}

.profile-stat-value {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
}

.profile-tiers h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.tiers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.tier-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem;
    border: 1px solid var(--border-light);
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.02);
}

.tier-card img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.tier-card-mode {
    font-weight: 700;
}

.tier-card-tier,
.tier-card-rank {
    display: block;
}

.footer {
    margin-top: auto;
    padding: 1.2rem;
    color: var(--muted-foreground);
    text-align: center;
}

@keyframes skeleton-pulse {
    0% { opacity: .3; }
    50% { opacity: .6; }
    100% { opacity: .3; }
}

.skeleton-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: rgba(30, 41, 57, .2);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    min-height: 78px;
    overflow: hidden;
}

.skeleton-shimmer {
    width: 160px;
    min-height: 78px;
    background: linear-gradient(90deg, rgba(30, 41, 57, .3) 25%, rgba(30, 41, 57, .5) 50%, rgba(30, 41, 57, .3) 75%);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-info {
    flex: 1;
    padding: .75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .5rem;
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
    background: rgba(30, 41, 57, .4);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }

.skeleton-slots {
    display: flex;
    gap: .35rem;
    padding: .35rem 1rem;
    align-items: center;
}

.skeleton-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(30, 41, 57, .3);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@media (max-width: 1100px) {
    .leaderboard-item {
        flex-wrap: wrap;
    }

    .lb-tier-slots {
        justify-content: flex-start;
        padding-top: 0;
    }
}

@media (max-width: 820px) {
    .header {
        width: calc(100% - 1rem);
        top: 0.5rem;
    }

    .top-space {
        padding-top: 0.5rem;
    }

    .main-content {
        padding: 5.5rem 0.5rem 1rem;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 0;
        right: 0;
        background: var(--layout-sections-color);
        border: 2px solid var(--layout-item-outline);
        border-radius: var(--radius-lg);
        padding: 0.5rem;
        flex-direction: column;
    }

    .nav-menu.show,
    .mobile-menu-btn {
        display: flex;
    }

    .search-box {
        display: none;
    }

    .card-header,
    .profile-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .lb-shimmer-area,
    .lb-player-info,
    .lb-region,
    .lb-tier-slots {
        width: 100%;
    }

    .lb-region {
        align-items: flex-start;
        padding: 0 0.75rem 0.5rem;
    }
}
