.rankings-shell {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: stretch;
}

.city-remove-btn {
    white-space: nowrap;
}

.rank-section {
    margin-top: 26px;
}

.rank-search-bar {
    display: grid;
    grid-template-columns: auto minmax(180px, 320px) auto minmax(70px, auto);
    gap: 8px;
    align-items: center;
    margin: 0 0 18px;
}

.rank-search-bar label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.rank-search-input {
    min-height: 40px;
    padding: 8px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #0f1218;
    color: var(--text);
    outline: none;
}

.rank-search-count {
    color: var(--muted);
    font-size: 13px;
    min-height: 18px;
}

.rank-search-hit {
    border-radius: 3px;
    background: rgba(245, 211, 92, 0.3);
    color: #fff7c8;
    box-shadow: 0 0 0 1px rgba(245, 211, 92, 0.28);
}

.rank-search-hit.is-current {
    background: rgba(153, 90, 242, 0.75);
    color: #fff;
}

.rank-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.rank-table th,
.rank-table td {
    padding: 12px 10px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.rank-table th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.rank-table td {
    font-size: 14px;
    overflow-wrap: anywhere;
}

.rank-table th:nth-child(1),
.rank-table td:nth-child(1) {
    width: 58px;
}

.rank-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rank-avatar-inline {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.rank-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}

.rank-socials-cell {
    text-align: center !important;
}

.rank-socials-cell a {
    display: inline-block;
    vertical-align: middle;
    margin: 0 4px;
}

.rank-socials-cell a:hover {
    color: var(--primary, #a855f7);
}

.rank-socials-cell svg {
    fill: currentColor;
    vertical-align: middle;
}

.row-menu {
    position: relative;
    display: inline-block;
}

.row-menu > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
}

.row-menu > summary::-webkit-details-marker {
    display: none;
}

.row-menu-panel {
    position: absolute;
    top: 44px;
    right: 0;
    z-index: 30;
    min-width: 260px;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}

.row-menu-panel form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.row-menu-panel input {
    width: 100%;
}

.row-menu-panel .btn {
    width: 100%;
    justify-content: center;
}

.rank-empty {
    padding: 18px 0;
    color: var(--muted);
}

.row-menu-remove-form {
    margin-top: 10px;
}

/* Confirmation modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.modal-box p {
    font-size: 16px;
    margin: 0 0 20px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-actions .btn {
    min-width: 100px;
}

.rank-table th:nth-child(3),
.rank-table td:nth-child(3) {
    width: 160px; /* adjust this value */
}
.rank-table th:nth-child(4),
.rank-table td:nth-child(4) {
    width: 160px; /* adjust this value */
}

.rank-table th:nth-child(5),
.rank-table td:nth-child(5) {
    width: 160px; /* adjust this value */
}

.rank-table th:nth-child(6),
.rank-table td:nth-child(6) {
    width: 160px; /* adjust this value */
}

.rank-table th:nth-child(7),
.rank-table td:nth-child(7) {
    width: 80px; /* adjust this value */
}

@media (max-width: 640px) {
    .card.large {
        padding: 10px 6px;
        border-radius: var(--radius);
    }

    .rank-search-bar {
        grid-template-columns: 1fr auto;
        gap: 6px;
    }

    .rank-search-bar label,
    .rank-search-count {
        grid-column: 1 / -1;
        font-size: 11px;
    }

    .rank-search-input {
        min-height: 32px;
        padding: 6px 8px;
        font-size: 12px;
    }

    .rank-section {
        margin-top: 20px;
        padding-bottom: 12px;
    }

    .rank-section h2 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .rank-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .rank-table {
        table-layout: fixed;
        transform: scale(0.9);
        transform-origin: top left;
        width: calc(100% / 0.9);
        margin-bottom: calc(-10% + 2px);
    }

    .rank-table th:nth-child(1),
    .rank-table td:nth-child(1) {
        width: 24px !important;
    }

    .rank-table th:nth-child(3),
    .rank-table td:nth-child(3) {
        width: 82px; /* adjust this value */
    }
    .rank-table th:nth-child(4),
    .rank-table td:nth-child(4) {
        width: 48px; /* adjust this value */
    }
    .rank-table th:nth-child(5),
    .rank-table td:nth-child(5) {
        width: 48px; /* adjust this value */
    }
    .rank-table th:nth-child(6),
    .rank-table td:nth-child(6) {
        width: 48px; /* adjust this value */
    }
    .rank-table th:nth-child(7),
    .rank-table td:nth-child(7) {
        width: 38px; /* adjust this value */
    }


    .rank-table th,
    .rank-table td {
        padding: 5px 4px;
        font-size: 10px;
        line-height: 1.15;
        white-space: normal;
    }

    .rank-avatar {
        width: 24px;
        height: 24px;
    }

    .rank-name-cell {
        min-width: 0;
        gap: 4px;
    }

    .rank-name-cell > span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .social-icon svg {
        width: 14px;
        height: 14px;
    }

    .rank-table td .btn.small,
    .rank-table td .btn,
    .row-menu > summary {
        min-height: 24px;
        height: 24px;
        min-width: 0;
        padding: 3px 4px;
        font-size: 9px;
    }

    .row-menu-panel {
        min-width: 220px;
        max-width: calc(100vw - 32px);
    }

    .row-menu > summary {
        width: 24px;
    }
}

