/* ===== RANKINGS PERSONALIZADOS ===== */

.rank-main {
    max-width: 600px;
    margin: 80px auto 40px;
    padding: 0 16px;
}

.rank-header {
    text-align: center;
    margin-bottom: 20px;
}

.rank-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 6px;
    background: linear-gradient(135deg, #f59e0b, #ef4444, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rank-header h1 i { -webkit-text-fill-color: #f59e0b; }

.rank-header p {
    color: rgba(255,255,255,0.45);
    margin: 0;
    font-size: 0.9rem;
}

/* Tabs */
.rank-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}

.rank-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.rank-tab.active {
    background: rgba(245,158,11,0.15);
    color: #f59e0b;
}

/* Cards */
.rank-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 80px;
}

.rank-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.rank-card:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(245,158,11,0.2);
}

.rank-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    text-transform: capitalize;
}

.rank-card-private {
    color: rgba(255,255,255,0.25);
}

.rank-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
}

.rank-card-desc {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.35);
    margin: 0 0 10px;
}

/* Preview */
.rank-card-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    overflow-x: auto;
    scrollbar-width: none;
}

.rank-card-preview::-webkit-scrollbar { display: none; }

.rank-preview-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    flex-shrink: 0;
}

.rank-preview-pos {
    font-size: 0.75rem;
    font-weight: 800;
    color: #f59e0b;
    min-width: 14px;
}

.rank-preview-item img {
    width: 24px;
    height: 34px;
    object-fit: cover;
    border-radius: 4px;
}

.rank-preview-placeholder {
    width: 24px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    color: rgba(255,255,255,0.2);
    font-size: 0.6rem;
}

.rank-preview-titulo {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-preview-more {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.3);
    font-weight: 600;
}

.rank-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
}

.rank-card-actions {
    display: flex;
    gap: 4px;
}

.rank-card-actions button {
    background: none;
    border: none;
    color: rgba(255,255,255,0.25);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 4px 6px;
}

.rank-card-actions button:hover { color: rgba(255,255,255,0.6); }

/* FAB */
.rank-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    border: none;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(245,158,11,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    z-index: 100;
}

.rank-fab:hover { transform: scale(1.1); }

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

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

.rank-modal {
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
}

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

.rank-modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.rank-modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 1.1rem;
    cursor: pointer;
}

.rank-modal-body { padding: 20px; }

.rank-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Form */
.rank-form-group {
    margin-bottom: 16px;
}

.rank-form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    margin-bottom: 6px;
}

.rank-form-group input,
.rank-form-group textarea,
.rank-form-group select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
}

.rank-form-group input:focus,
.rank-form-group textarea:focus {
    border-color: rgba(245,158,11,0.4);
}

.rank-form-group select option { background: #1a1a2e; }

/* Search */
.rank-search-wrap { position: relative; }

.rank-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
}

.rank-search-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    transition: background 0.2s;
}

.rank-search-item:hover { background: rgba(255,255,255,0.05); }

.rank-search-item img {
    width: 28px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.rank-search-ph {
    width: 28px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    color: rgba(255,255,255,0.2);
}

.rank-search-empty {
    padding: 12px;
    text-align: center;
    color: rgba(255,255,255,0.3);
    font-size: 0.8rem;
}

/* Editor Items */
.rank-items-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rank-items-empty {
    text-align: center;
    color: rgba(255,255,255,0.25);
    padding: 20px;
    font-size: 0.8rem;
}

.rank-editor-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    cursor: grab;
    transition: all 0.2s;
}

.rank-editor-item:active { cursor: grabbing; }

.rank-dragging {
    opacity: 0.4;
    border-color: rgba(245,158,11,0.4);
}

.rank-editor-handle {
    color: rgba(255,255,255,0.2);
    font-size: 0.8rem;
}

.rank-editor-pos {
    font-size: 0.8rem;
    font-weight: 800;
    color: #f59e0b;
    min-width: 20px;
    text-align: center;
}

.rank-editor-item img {
    width: 28px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.rank-editor-ph {
    width: 28px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    color: rgba(255,255,255,0.2);
}

.rank-editor-titulo {
    flex: 1;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-editor-remove {
    background: none;
    border: none;
    color: rgba(255,255,255,0.2);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 4px;
}

.rank-editor-remove:hover { color: #ef4444; }

.rank-drag-hint {
    text-align: center;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.2);
    margin: 6px 0 0;
}

.rank-publico-toggle {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.rank-btn-salvar {
    padding: 10px 24px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

/* View Modal */
.rank-view-desc {
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
    margin: 0 0 16px;
}

.rank-view-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rank-view-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
    transition: all 0.2s;
}

.rank-view-item:hover { background: rgba(255,255,255,0.04); }

.rank-view-top {
    background: rgba(245,158,11,0.04);
    border: 1px solid rgba(245,158,11,0.1);
}

.rank-view-pos {
    font-size: 1rem;
    font-weight: 800;
    color: rgba(255,255,255,0.3);
    min-width: 28px;
    text-align: center;
}

.rank-medal { font-size: 1.2rem; }

.rank-view-poster {
    width: 36px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
}

.rank-view-placeholder {
    width: 36px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    color: rgba(255,255,255,0.2);
}

.rank-view-titulo {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

/* Loading & Empty */
.rank-loading, .rank-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.4);
    gap: 12px;
    text-align: center;
}

.rank-loading i, .rank-empty i {
    font-size: 2.5rem;
    color: #f59e0b;
}

/* Responsive */
@media (max-width: 480px) {
    .rank-main { margin-top: 70px; padding: 0 10px; }
    .rank-card { padding: 12px; }
    .rank-fab { bottom: 16px; right: 16px; width: 50px; height: 50px; font-size: 1.1rem; }
}

/* Light theme: surfaces, content and interaction states. */
:is(html.light-theme-early, body.light-theme) .rank-header p,
:is(html.light-theme-early, body.light-theme) .rank-tab,
:is(html.light-theme-early, body.light-theme) .rank-card-top,
:is(html.light-theme-early, body.light-theme) .rank-card-private,
:is(html.light-theme-early, body.light-theme) .rank-card-desc,
:is(html.light-theme-early, body.light-theme) .rank-preview-titulo,
:is(html.light-theme-early, body.light-theme) .rank-preview-more,
:is(html.light-theme-early, body.light-theme) .rank-card-footer,
:is(html.light-theme-early, body.light-theme) .rank-card-actions button,
:is(html.light-theme-early, body.light-theme) .rank-modal-close,
:is(html.light-theme-early, body.light-theme) .rank-form-group label,
:is(html.light-theme-early, body.light-theme) .rank-search-empty,
:is(html.light-theme-early, body.light-theme) .rank-items-empty,
:is(html.light-theme-early, body.light-theme) .rank-editor-handle,
:is(html.light-theme-early, body.light-theme) .rank-editor-remove,
:is(html.light-theme-early, body.light-theme) .rank-drag-hint,
:is(html.light-theme-early, body.light-theme) .rank-publico-toggle,
:is(html.light-theme-early, body.light-theme) .rank-view-desc,
:is(html.light-theme-early, body.light-theme) .rank-view-pos,
:is(html.light-theme-early, body.light-theme) .rank-loading,
:is(html.light-theme-early, body.light-theme) .rank-empty {
    color: var(--text-muted, #526070);
}

:is(html.light-theme-early, body.light-theme) .rank-card-title,
:is(html.light-theme-early, body.light-theme) .rank-modal-header h2,
:is(html.light-theme-early, body.light-theme) .rank-search-item,
:is(html.light-theme-early, body.light-theme) .rank-editor-titulo,
:is(html.light-theme-early, body.light-theme) .rank-view-titulo {
    color: var(--text, #1e293b);
}

:is(html.light-theme-early, body.light-theme) .rank-tabs,
:is(html.light-theme-early, body.light-theme) .rank-preview-item,
:is(html.light-theme-early, body.light-theme) .rank-editor-item,
:is(html.light-theme-early, body.light-theme) .rank-view-item {
    background: var(--surface2, #f8f7f3); border-color: var(--border, rgba(30, 41, 59, .12));
}

:is(html.light-theme-early, body.light-theme) .rank-card,
:is(html.light-theme-early, body.light-theme) .rank-modal,
:is(html.light-theme-early, body.light-theme) .rank-search-results {
    background: var(--surface, #fff); border-color: var(--border, rgba(30, 41, 59, .12));
}

:is(html.light-theme-early, body.light-theme) .rank-card:hover,
:is(html.light-theme-early, body.light-theme) .rank-search-item:hover,
:is(html.light-theme-early, body.light-theme) .rank-view-item:hover {
    background: #edeaf5; border-color: rgba(109, 40, 217, .22);
}

:is(html.light-theme-early, body.light-theme) .rank-card-actions button:hover,
:is(html.light-theme-early, body.light-theme) .rank-modal-close:hover {
    color: var(--text, #1e293b);
}

:is(html.light-theme-early, body.light-theme) .rank-tab.active,
:is(html.light-theme-early, body.light-theme) .rank-preview-pos,
:is(html.light-theme-early, body.light-theme) .rank-editor-pos {
    color: var(--accent-ink, #806117);
}

:is(html.light-theme-early, body.light-theme) .rank-tab.active {
    background: #fff0cc;
}

:is(html.light-theme-early, body.light-theme) .rank-preview-placeholder,
:is(html.light-theme-early, body.light-theme) .rank-search-ph,
:is(html.light-theme-early, body.light-theme) .rank-editor-ph,
:is(html.light-theme-early, body.light-theme) .rank-view-placeholder {
    background: var(--surface2, #f8f7f3); border-color: var(--border, rgba(30, 41, 59, .12)); color: var(--text-muted, #526070);
}

:is(html.light-theme-early, body.light-theme) .rank-modal-header,
:is(html.light-theme-early, body.light-theme) .rank-modal-footer {
    border-color: var(--border, rgba(30, 41, 59, .12));
}

:is(html.light-theme-early, body.light-theme) .rank-form-group input,
:is(html.light-theme-early, body.light-theme) .rank-form-group textarea,
:is(html.light-theme-early, body.light-theme) .rank-form-group select {
    background: var(--surface2, #f8f7f3); border-color: var(--border, rgba(30, 41, 59, .12)); color: var(--text, #1e293b);
}

:is(html.light-theme-early, body.light-theme) .rank-form-group input::placeholder,
:is(html.light-theme-early, body.light-theme) .rank-form-group textarea::placeholder {
    color: var(--text-muted, #526070);
}

:is(html.light-theme-early, body.light-theme) .rank-form-group select option {
    background: var(--surface, #fff); border-color: var(--border, rgba(30, 41, 59, .12)); color: var(--text, #1e293b);
}

:is(html.light-theme-early, body.light-theme) .rank-form-group input:focus,
:is(html.light-theme-early, body.light-theme) .rank-form-group textarea:focus,
:is(html.light-theme-early, body.light-theme) .rank-form-group select:focus {
    border-color: #a16207; box-shadow: 0 0 0 3px rgba(161, 98, 7, .12);
}

:is(html.light-theme-early, body.light-theme) .rank-view-top {
    background: #fff7e5; border-color: #e1bc74;
}

:is(html.light-theme-early, body.light-theme) .rank-editor-remove:hover {
    color: #b91c1c;
}

:is(html.light-theme-early, body.light-theme) .rank-fab,
:is(html.light-theme-early, body.light-theme) .rank-btn-salvar {
    background: linear-gradient(135deg, #c2410c, #be185d); color: #fff; border-color: transparent;
}

:is(html.light-theme-early, body.light-theme) .rank-header h1 { background-image: linear-gradient(135deg, #a16207, #b91c1c, #6d28d9); }
:is(html.light-theme-early, body.light-theme) .rank-header h1 i { -webkit-text-fill-color: #a16207; }

:is(html.light-theme-early, body.light-theme) .rank-loading i,
:is(html.light-theme-early, body.light-theme) .rank-empty i { color: var(--accent-ink, #806117); }
