:root {
    --rk-bg: #1b2632;
    --rk-card: #212630;
    --rk-card-2: #2c3444;
    --rk-border: #2b303c;
    --rk-text: #d7e0ea;
    --rk-dim: #91a0b3;
    --rk-accent: #ffd666;
    --rk-shadow: 0 8px 24px rgba(0, 0, 0, .35);
    --rk-success: #1e8c55;
}

.sub-wrapper .center-side {
    overflow: visible;
}

.rank-lookup {
    display: flex;
    align-items: start;
    gap: 1rem;
}

.rank-links {
    width: 350px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(45deg, #2a2f3c, #252a35b0);
    border-radius: 12px;
    padding: 1rem;
    position: sticky;
    top: 90px;
}

.rank-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 14px;
    background: #393e50;
    border-radius: 8px;
    color: #eee;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s, transform 0.15s;
}

.rank-link:hover {
    background: #464e6b;
    transform: translateX(3px);
    color: #fff;
}

.rank-link.active {
    background: #454e6e;
}

.rank-separator {
    border: none;
    border-top: 1px solid #668bd8;
    margin: 8px 0;
}

.rank-link.highlight {
    background: #222;
    border: 1px solid #444;
}

.rank-link.highlight:hover {
    background: #333;
    border-color: #555;
}

.rank-list {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.rank-item {
    background: linear-gradient(180deg, var(--rk-card), var(--rk-card-2));
    border: 1px solid var(--rk-border);
    border-radius: 10px;
    padding: 5px;
    display: grid;
    grid-template-columns: 40px 250px 150px 1fr;
    align-items: center;
    gap: 14px;
    justify-content: space-between;
    transition: transform .15s, box-shadow .15s, border-color .15s;
    font-size: 11px;
}

.rank-list.guild .rank-item {
    grid-template-columns: 40px 60px 200px 150px 1fr;
}

.symbol {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rank-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--rk-shadow);
    border-color: #2a3f56;
}

.rank-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
}

.rank-badge {
    width: 35px;
    height: 35px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #0f141b;
    background: #94a3b8;
    font-size: 13px;
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffb224);
    color: #3a2d00;
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, #d6dae1, #aeb8c4);
    color: #1c2430;
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, #eab08c, #d58542);
    color: #3b2412;
}

.rank-id .rank-name {
    color: var(--rk-text);
    font-weight: 600;
    font-size: 13px;
}

.rank-id .rank-clan {
    color: var(--rk-dim);
    font-size: 11px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.rank-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--rk-text);
}

.chip-points {
    background: rgba(32, 114, 74, .12);
    border-color: rgba(30, 140, 85, .35);
    color: #bff3d6;
    font-weight: 600;
}

.rank-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.rank-perpage {
    width: auto;
    background: var(--rk-card-2);
    color: var(--rk-text);
    border-color: var(--rk-border);
    border-radius: 10px;
    padding: 4px 28px 4px 10px;
}

/* Empty & Skeleton */
.rank-empty {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    color: var(--rk-dim);
    background: var(--rk-card);
    border: 1px dashed var(--rk-border);
    border-radius: 16px;
    padding: 20px;
}

.rank-skeleton {
    display: none;
}

.rank-skeleton.show {
    display: block;
}

.rank-skeleton .skeleton-line {
    height: 58px;
    border-radius: 16px;
    background: linear-gradient(90deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .08), rgba(255, 255, 255, .05));
    animation: rk-shimmer 1.2s infinite;
    margin-bottom: 10px;
}

.rank-id {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

@keyframes rk-shimmer {
    0% {
        filter: brightness(100%)
    }

    50% {
        filter: brightness(140%)
    }

    100% {
        filter: brightness(100%)
    }
}

@media (max-width:768px) {
    .rank-item {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
        display: flex;
        justify-content: normal;
        align-items: center;
    }

    .rank-left {
        min-width: unset;
        width: 36px;
    }

    .rank-left:nth-child(2) {
        width: calc(100% - 56px);
    }

    .rank-right {
        width: calc((100% - 18px) / 2);
    }

    .chip-points {
        width: 100%;
        justify-content: center;
    }

    .rank-footer {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .rank-lookup {
        flex-direction: column;
    }

    .rank-links {
        width: 100%;
        position: relative;
        top: unset;
    }
}