/* ============================================================
   Tabo Ranking — style v1.0.0
   ============================================================ */

.tabo-ranking-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 1.5rem 0;
    max-width: 680px;
}

/* Zakładki */
.tabo-ranking-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    border-bottom: 2px solid #e5e5e5;
    padding-bottom: 0;
}

.tabo-ranking-tab {
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #888;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
    border-radius: 0;
}

.tabo-ranking-tab:hover  { color: #9147ff; }
.tabo-ranking-tab.active { color: #9147ff; border-bottom-color: #9147ff; font-weight: 600; }

/* Body */
.tabo-ranking-body { position: relative; }

.tabo-ranking-loading {
    text-align: center;
    padding: 2rem;
    color: #aaa;
    font-size: 14px;
}

.tabo-ranking-error {
    padding: 1rem;
    background: #fff3f3;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #b91c1c;
    font-size: 13px;
}

/* Lista */
.tabo-ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Wiersz */
.tabo-ranking-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.tabo-ranking-row:hover { background: #fafafa; }

/* Top 3 */
.tabo-ranking-row.top-1 { background: #fffbeb; border-color: #fde68a; }
.tabo-ranking-row.top-2 { background: #f8f8f8; border-color: #d1d5db; }
.tabo-ranking-row.top-3 { background: #fff7f0; border-color: #fed7aa; }

.tabo-ranking-row.top-1:hover { background: #fef3c7; }
.tabo-ranking-row.top-2:hover { background: #f0f0f0; }
.tabo-ranking-row.top-3:hover { background: #ffedd5; }

/* Pozycja / medal */
.tabo-ranking-pos {
    min-width: 36px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #bbb;
    flex-shrink: 0;
}

.tabo-ranking-medal {
    font-size: 20px;
    line-height: 1;
}

/* Avatar */
.tabo-ranking-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #888;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.tabo-ranking-avatar::before {
    content: attr(data-initials);
    position: absolute;
    font-size: 12px;
    font-weight: 700;
    color: #888;
}

.tabo-ranking-avatar.has-img::before { display: none; }

.tabo-ranking-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: none;
    position: relative;
    z-index: 1;
}

/* Nick */
.tabo-ranking-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Wartość */
.tabo-ranking-value {
    font-size: 13px;
    font-weight: 600;
    color: #9147ff;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Footer */
.tabo-ranking-footer {
    margin-top: 10px;
    font-size: 11px;
    color: #bbb;
    text-align: right;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .tabo-ranking-tabs      { border-bottom-color: #333; }
    .tabo-ranking-tab       { color: #666; }
    .tabo-ranking-tab:hover,
    .tabo-ranking-tab.active { color: #a78bfa; }
    .tabo-ranking-tab.active { border-bottom-color: #a78bfa; }

    .tabo-ranking-row       { background: #18181b; border-color: #27272a; }
    .tabo-ranking-row:hover { background: #1f1f23; }

    .tabo-ranking-row.top-1 { background: #1c1a0e; border-color: #78350f; }
    .tabo-ranking-row.top-2 { background: #1a1a1a; border-color: #3f3f46; }
    .tabo-ranking-row.top-3 { background: #1c1510; border-color: #7c2d12; }

    .tabo-ranking-name      { color: #e5e5e5; }
    .tabo-ranking-value     { color: #a78bfa; }
    .tabo-ranking-avatar    { background: #27272a; }
    .tabo-ranking-error     { background: #2d0a0a; border-color: #7f1d1d; color: #fca5a5; }
}

@media (max-width: 480px) {
    .tabo-ranking-tab  { font-size: 12px; padding: 7px 10px; }
    .tabo-ranking-name { font-size: 13px; }
    .tabo-ranking-row  { padding: 8px 10px; gap: 9px; }
}

/* Toolbar (tylko dla follow) */
.tabo-ranking-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 10px;
}

.tabo-ranking-total {
    font-size: 13px;
    color: #888;
}

.tabo-ranking-sort-btn {
    font-size: 12px;
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid #9147ff;
    background: transparent;
    color: #9147ff;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tabo-ranking-sort-btn:hover {
    background: #9147ff;
    color: #fff;
}

/* Wiersz follow — dodatkowa kolumna z datą */
.tabo-ranking-row--follow {
    display: grid;
    grid-template-columns: 36px 36px 1fr auto auto;
    align-items: center;
    gap: 12px;
}

.tabo-ranking-follow-date {
    font-size: 12px;
    color: #aaa;
    white-space: nowrap;
    text-align: right;
}

@media (max-width: 480px) {
    .tabo-ranking-row--follow {
        grid-template-columns: 28px 32px 1fr auto;
        gap: 8px;
    }
    .tabo-ranking-follow-date {
        display: none;
    }
}

@media (prefers-color-scheme: dark) {
    .tabo-ranking-sort-btn { border-color: #a78bfa; color: #a78bfa; }
    .tabo-ranking-sort-btn:hover { background: #a78bfa; color: #fff; }
    .tabo-ranking-follow-date { color: #666; }
    .tabo-ranking-total { color: #666; }
}

/* ============================================================
   Zakładka Banlist
   ============================================================ */

.tabo-banlist-col {
    min-width: 80px;
    text-align: center;
    font-family: var(--font-mono, monospace);
    font-size: 13px;
    flex-shrink: 0;
}

.tabo-banlist-header-row {
    border-bottom: 1px solid rgba(145,71,255,0.2) !important;
    background: transparent !important;
}

.tabo-banlist-header-row:hover {
    background: transparent !important;
}

.tabo-banlist-header-row .tabo-banlist-col {
    font-size: 10px;
    letter-spacing: 0.12em;
    color: #9147ff;
    font-weight: 700;
}

.sortable-col { transition: color 0.2s; }
.sortable-col:hover { color: #a78bfa !important; }
.sortable-col.active { color: #fff !important; }

.tabo-ranking-row.tabo-banlist-data-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
