#lb-container {
    width: 75%;
    margin: 0 auto;
    max-height: 65vh;
    overflow-y: auto;
    overflow-x: hidden;
}

#lb-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 16px auto 0;
    width: 75%;
}

#lb-tabs button {
    height: 36px;
    padding: 0 18px;
    background: #242424;
    color: #aaa;
    border: 1px solid #363636;
    border-radius: 18px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

#lb-tabs button:hover { background: #2d2d2d; color: #fff; }
#lb-tabs button.active { background: #3d5f87; border-color: #3d5f87; color: #fff; }

#lb {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 4px;
    color: #e0e0e0;
}

.lb-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 76px;
    padding: 10px 24px 10px 8px;
    background: #242424 center / cover no-repeat;
    border: 1px solid #363636;
    border-radius: 12px;
    font-size: 18px;
    overflow: hidden;
    transition: background-color 0.12s, border-color 0.12s, transform 0.12s;
}

.lb-row:hover { background-color: #2d2d2d; border-color: #4a4a4a; transform: translateY(-1px); }

/* keep text readable on top of a custom background */
.lb-row.has-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(20, 20, 20, 0.85), rgba(20, 20, 20, 0.45));
}

.lb-row > * { position: relative; }
.lb-row.has-bg > * { text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); }

.lb-rank {
    width: 64px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #aaa;
}

.lb-row:nth-child(1) .lb-rank { color: #ffd700; }
.lb-row:nth-child(2) .lb-rank { color: #c0c0c0; }
.lb-row:nth-child(3) .lb-rank { color: #cd7f32; }

.lb-avatar {
    flex: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    background: #363636;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
}

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

.lb-name { flex: 1; min-width: 0; font-size: 20px; font-weight: 600; word-break: break-word; }
.lb-hardest { flex: none; width: 240px; display: flex; flex-direction: column; text-align: left; overflow: hidden; }
.lb-hardest-label { color: #777; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.lb-hardest-value { color: #ddd; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-points { flex: none; min-width: 90px; text-align: right; font-weight: 700; color: #fff; }
.lb-empty { text-align: center; color: #aaa; padding: 24px; }

@media (max-width: 700px) {
    .lb-hardest { display: none; }
    .lb-row { font-size: 16px; gap: 10px; }
    .lb-rank { width: 40px; }
}

body {
    font-family: Arial, sans-serif;
    background-color: #1e1e1e;
    margin: 0;
    padding: 0;
}

.lb-row a {
    color: #fff;
    text-decoration: none;
}

#podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    margin: 40px auto;
    width: 75%;
}

.podium-spot {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 160px;
}

.podium-info {
    text-align: center;
    margin-bottom: 10px;
    color: #e0e0e0;
}

.podium-name {
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 4px;
    word-break: break-word;
}

.podium-name a {
    color: #fff;
    text-decoration: none;
}

.podium-points {
    font-size: 13px;
    color: #aaa;
}

.podium-block {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12px;
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    border-radius: 6px 6px 0 0;
}

.rank-1 {
    height: 140px;
    background: linear-gradient(#ffd700, #b8960c);
    order: 2;
}

.rank-2 {
    height: 100px;
    background: linear-gradient(#c0c0c0, #8a8a8a);
    order: 1;
}

.rank-3 {
    height: 70px;
    background: linear-gradient(#cd7f32, #8a5a20);
    order: 3;
}

#podium-1 { order: 2; }
#podium-2 { order: 1; }
#podium-3 { order: 3; }

.lb-row.editable { cursor: pointer; }
.lb-row.editable:hover { border-color: #5a7fa8; }

.lb-remove-bg {
    flex: none;
    height: 30px;
    padding: 0 12px;
    background: rgba(30, 30, 30, 0.8);
    color: #ddd;
    border: 1px solid #4a4a4a;
    border-radius: 5px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s, background 0.12s;
}
.lb-row:hover .lb-remove-bg { opacity: 1; }
.lb-remove-bg:hover { background: #6b2a2a; }

#lb-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px);
    padding: 12px 20px; background: #242424; color: #fff; border: 1px solid #363636; border-radius: 8px;
    opacity: 0; pointer-events: none; z-index: 100; transition: opacity 0.25s, transform 0.25s;
}
#lb-toast.show { opacity: 1; transform: translate(-50%, 0); }
#lb-toast.ok { border-color: #6f6; }
#lb-toast.err { border-color: #f66; }

.bouncy { --bouncy-squish-headroom: 0.12em; font-kerning: none; font-variant-ligatures: none; margin-block: calc(var(--bouncy-squish-headroom) * -1); padding-block: var(--bouncy-squish-headroom); text-decoration: none; }
.bouncy > span { display: inline-block; white-space: pre; animation: bouncy-squish 4s cubic-bezier(.44, .29, .48, 1); animation-delay: calc(var(--letter-index, 0) * 50ms); animation-fill-mode: forwards; animation-iteration-count: infinite; }
@keyframes bouncy-squish {
    0%, 35%, 100% { transform: scaleX(1) scaleY(1); }
    7%  { transform: scaleX(1.28) scaleY(.72); }
    14% { transform: scaleX(.82) scaleY(1.18); }
    21% { transform: scaleX(1.1) scaleY(.9); }
    28% { transform: scaleX(.96) scaleY(1.04); }
}
.lb-row a, .lb-row a > span { text-shadow: none; }

@media (max-width: 700px) {
    #lb-container { width: 94%; max-height: none; }
    #lb-tabs { width: 94%; gap: 6px; }
    #lb-tabs button { height: 32px; padding: 0 12px; font-size: 13px; }
    #podium { width: 94%; gap: 8px; margin: 24px auto; }
    .podium-spot { width: 31%; min-width: 0; }
    .podium-name { font-size: 13px; }
    .podium-block { font-size: 22px; }
    .lb-row { padding: 8px 12px 8px 6px; min-height: 64px; gap: 8px; }
    .lb-avatar { width: 42px; height: 42px; }
    .lb-name { font-size: 17px; }
    .lb-rank { width: 34px; font-size: 18px; }
    .lb-points { min-width: 0; font-size: 15px; }
    .lb-remove-bg { opacity: 1; }
}
