/* SnakeFun leaderboard panel */
.lb {
    --lb-ink: #1d2817;
    --lb-muted: #66735e;
    --lb-line: #ebe6d9;
    --lb-soft: #f6f4ec;
    --lb-accent: #4e7cf6;
    background: #fff;
    border: 1px solid var(--lb-line);
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(29, 40, 23, 0.06), 0 8px 24px rgba(29, 40, 23, 0.06);
    padding: 16px;
    color: var(--lb-ink);
    font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    scroll-margin-top: 12px;
}

.lb-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.lb-title {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.lb-tabs {
    display: flex;
    padding: 3px;
    border-radius: 12px;
    background: var(--lb-soft);
}

.lb-tab {
    border: 0;
    background: none;
    padding: 5px 10px;
    border-radius: 9px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--lb-muted);
    cursor: pointer;
}

.lb-tab[aria-selected="true"] {
    background: #fff;
    color: var(--lb-ink);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.lb-filters {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
}

.lb-filters[hidden] {
    display: none;
}

.lb-seg {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.lb-segbtn {
    flex: 1 1 auto;
    border: 1.5px solid var(--lb-line);
    background: #fff;
    padding: 5px 8px;
    border-radius: 9px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--lb-muted);
    cursor: pointer;
    white-space: nowrap;
}

.lb-segbtn:hover {
    border-color: #cfd8c3;
}

.lb-modes .lb-segbtn[aria-pressed="true"] {
    background: var(--lb-ink);
    border-color: var(--lb-ink);
    color: #fff;
}

.lb-periods .lb-segbtn[aria-pressed="true"] {
    background: #e8f3d9;
    border-color: #b9d79a;
    color: #2b4f18;
}

.lb-tab:focus-visible,
.lb-segbtn:focus-visible,
.lb-link:focus-visible,
.lb-save:focus-visible {
    outline: 3px solid #ffd54f;
    outline-offset: 2px;
}

.lb-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 2px;
    min-height: 220px;
    transition: opacity 0.15s;
}

.lb-loading .lb-list {
    opacity: 0.55;
}

.lb-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 12px;
}

.lb-row:nth-child(odd) {
    background: #fbfaf6;
}

.lb-row.lb-you {
    background: #eef3ff;
    box-shadow: inset 0 0 0 1.5px #c7d6fd;
}

.lb-rank {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 13px;
    color: var(--lb-muted);
    background: var(--lb-soft);
    font-variant-numeric: tabular-nums;
}

.lb-rank-1 {
    background: linear-gradient(135deg, #ffe082, #f2b705);
    color: #5c4300;
}

.lb-rank-2 {
    background: linear-gradient(135deg, #eceff1, #b0bec5);
    color: #37474f;
}

.lb-rank-3 {
    background: linear-gradient(135deg, #ffccbc, #d7865b);
    color: #5d2f12;
}

.lb-who {
    min-width: 0;
}

.lb-name {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    min-width: 0;
}

.lb-nametext {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-flag {
    flex: none;
}

.lb-youtag {
    flex: none;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--lb-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 17px;
}

.lb-meta {
    color: var(--lb-muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-pts {
    font-weight: 800;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.lb-pts::after {
    content: " pts";
    font-size: 11px;
    font-weight: 700;
    color: var(--lb-muted);
}

.lb-skel {
    height: 44px;
    background: linear-gradient(90deg, #f4f2ea 0%, #fbfaf6 50%, #f4f2ea 100%) !important;
    background-size: 200% 100% !important;
    animation: lb-shimmer 1.2s linear infinite;
}

@keyframes lb-shimmer {
    to {
        background-position: -200% 0;
    }
}

.lb-empty {
    padding: 28px 12px;
    text-align: center;
    color: var(--lb-muted);
}

.lb-foot {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--lb-line);
    display: grid;
    gap: 6px;
    font-size: 13px;
}

.lb-foot:empty {
    display: none;
}

.lb-me b {
    color: var(--lb-accent);
}

.lb-namerow {
    color: var(--lb-muted);
}

.lb-note {
    display: block;
    font-size: 11.5px;
    opacity: 0.85;
}

.lb-link {
    border: 0;
    background: none;
    padding: 0;
    color: var(--lb-accent);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
}

.lb-nameform {
    display: flex;
    gap: 6px;
}

.lb-nameform input {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    border: 1.5px solid var(--lb-line);
    border-radius: 8px;
    font: inherit;
    font-size: 16px;
}

.lb-save {
    border: 0;
    border-radius: 8px;
    padding: 6px 12px;
    background: var(--lb-ink);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.lb-rule {
    margin: 0;
    color: var(--lb-muted);
    font-size: 11.5px;
}
