/* =========================================================
   LEADERBOARD + PROFILE PATCH
   ========================================================= */

.lb-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(4, 3, 9, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.lb-modal-overlay.show {
    display: flex;
    animation: lbFadeIn .18s ease;
}

@keyframes lbFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lb-modal {
    position: relative;
    width: min(480px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background: var(--panel, #11101c);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: lbSlideUp .22s ease;
}

@keyframes lbSlideUp {
    from { transform: translateY(14px) scale(.98); opacity: 0; }
    to   { transform: translateY(0)    scale(1);   opacity: 1; }
}

.lb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.lb-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text, #f6f3ff);
    letter-spacing: -0.02em;
}

.lb-modal-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text, #fff);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .15s ease;
}

.lb-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lb-modal-body {
    padding: 12px 16px 18px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.lb-modal-body::-webkit-scrollbar { width: 5px; }
.lb-modal-body::-webkit-scrollbar-thumb {
    background: #2b2739;
    border-radius: 99px;
}

/* ---------- LEADERBOARD ROWS ---------- */

.lb-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 14px;
    transition: background .15s ease;
}

.lb-row.clickable {
    cursor: pointer;
}

.lb-row.clickable:hover {
    background: rgba(255, 255, 255, 0.05);
}

.lb-row.me {
    background: linear-gradient(90deg, rgba(155, 108, 255, 0.18), rgba(155, 108, 255, 0.06));
    border: 1px solid rgba(155, 108, 255, 0.22);
    margin-top: 8px;
}

.lb-rank {
    width: 34px;
    flex: 0 0 34px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--muted, #918ba5);
    font-variant-numeric: tabular-nums;
}

.lb-rank.medal {
    font-size: 20px;
}

.lb-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #382a5f, #211a37);
    color: #d9c9ff;
    font-weight: 700;
    font-size: 15px;
}

.lb-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    font-weight: 650;
    color: var(--text, #fff);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-score {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    color: #cbb8ff;
    font-variant-numeric: tabular-nums;
}

.lb-separator {
    margin: 14px 0 6px;
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
}

.lb-hint {
    text-align: center;
    color: var(--muted, #918ba5);
    font-size: 12px;
    margin-top: 12px;
}

.lb-empty {
    text-align: center;
    padding: 30px 10px;
    color: var(--muted, #918ba5);
    font-size: 14px;
}

/* ---------- PROFILE ---------- */

.pf-body {
    padding: 26px 22px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pf-avatar {
    width: 88px;
    height: 88px;
    border-radius: 26px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #b18cff, #6e43d8);
    color: #fff;
    font-weight: 800;
    font-size: 38px;
    box-shadow: 0 14px 40px rgba(130, 82, 235, 0.35);
    margin-bottom: 12px;
}

.pf-username {
    font-size: 20px;
    font-weight: 750;
    color: var(--text, #fff);
    letter-spacing: -0.02em;
    text-align: center;
    word-break: break-word;
    max-width: 100%;
}

.pf-since {
    font-size: 12px;
    color: var(--muted, #918ba5);
    margin-top: 2px;
    margin-bottom: 20px;
    text-align: center;
}

.pf-stat {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.055);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.pf-stat-label {
    font-size: 13px;
    color: var(--muted, #918ba5);
}

.pf-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text, #fff);
    font-variant-numeric: tabular-nums;
}

.pf-stat-value.fish {
    color: #cbb8ff;
    font-size: 18px;
}

.pf-logout {
    width: 100%;
    margin-top: 14px;
    padding: 13px 16px;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 102, 122, 0.12);
    color: #ff667a;
    font-weight: 650;
    font-size: 14px;
    cursor: pointer;
    transition: background .15s ease;
}

.pf-logout:hover {
    background: rgba(255, 102, 122, 0.2);
}

/* ---------- SIDEBAR BUTTONS (десктоп) ---------- */

.sidebar-meta {
    display: flex;
    gap: 6px;
    padding: 0 5px 8px;
    margin-top: 6px;
}

.sidebar-meta button {
    flex: 1 1 0;
    min-width: 0;
    padding: 9px 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--muted, #918ba5);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-meta button:hover {
    background: rgba(155, 108, 255, 0.14);
    color: #e6dcff;
}

/* Скрываем на мобильном — там нижняя навигация */
@media (max-width: 700px) {
    .sidebar-meta { display: none !important; }
}

/* ---------- BANNER PROGRESS ---------- */

.maintenance-fish-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.maintenance-fish-progress {
    width: 100%;
    max-width: 260px;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    overflow: hidden;
}

.maintenance-fish-progress > div {
    height: 100%;
    background: linear-gradient(90deg, #b18cff, #6e43d8);
    border-radius: 99px;
    transition: width .3s ease;
    width: 0;
}

