/* ============================================================
   discord-settings.css — Eclipse Zone
   Panel de ajustes estilo Discord + profile popup + emoji/sticker picker
   ============================================================ */

/* ─────────────────────────────────────────────────────────────
   NAV ACCOUNT BUTTON (5to botón con avatar del usuario)
   ───────────────────────────────────────────────────────────── */

.mobile-nav-account .nav-acct-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
    margin: 0 auto 2px;
    position: relative;
}

.mobile-nav-account .nav-acct-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.mobile-nav-account.active .nav-acct-avatar,
.mobile-nav-account:hover .nav-acct-avatar {
    border-color: var(--primary-color, #5865F2);
}

.mobile-nav-account .nav-acct-avatar .nav-acct-status {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #23a559;
    border: 2px solid var(--bg, #1a1a2e);
}

/* ─────────────────────────────────────────────────────────────
   DISCORD SETTINGS OVERLAY
   ───────────────────────────────────────────────────────────── */

#discordSettings {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: none;
    flex-direction: row;
    background: var(--bg, var(--ds-bg, #313338));
    animation: dsFadeIn 0.18s ease;
}

#discordSettings.ds-open {
    display: flex;
}

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

/* ── Sidebar ────────────────────────────────────────────── */
.ds-sidebar {
    width: 220px;
    min-width: 180px;
    background: var(--card-bg, var(--ds-sidebar, #2b2d31));
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 16px 6px 0;
    flex-shrink: 0;
    scrollbar-width: thin;
}

.ds-sidebar::-webkit-scrollbar { width: 3px; }
.ds-sidebar::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 3px; }

.ds-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ds-muted, #949ba4);
    padding: 8px 8px 4px;
    margin-top: 8px;
}

.ds-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ds-text-muted, #b5bac1);
    transition: background 0.12s, color 0.12s;
    margin-bottom: 1px;
    user-select: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.ds-nav-item i {
    font-size: 1rem;
    width: 18px;
    flex-shrink: 0;
}

.ds-nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: var(--ds-text, #f2f3f5);
}

.ds-nav-item.active {
    background: rgba(var(--primary-rgb, 88,101,242), 0.2);
    color: var(--primary-color, #5865F2);
    font-weight: 600;
}

.ds-nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 8px 8px;
}

/* ── User panel en la parte inferior del sidebar ─────── */
.ds-user-panel {
    margin-top: auto;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255,255,255,0.06);
    position: sticky;
    bottom: 0;
}

.ds-user-panel-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--primary-color, #5865F2);
}

.ds-user-panel-info {
    flex: 1;
    min-width: 0;
}

.ds-user-panel-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ds-text, #f2f3f5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ds-user-panel-status {
    font-size: 0.7rem;
    color: var(--ds-muted, #949ba4);
}

.ds-user-panel-logout {
    background: none;
    border: none;
    color: var(--ds-muted, #949ba4);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 1rem;
    transition: color 0.15s;
}

.ds-user-panel-logout:hover { color: #f23f43; }

/* ── Contenido principal ──────────────────────────────── */
.ds-content-wrap {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
}

.ds-content-wrap::-webkit-scrollbar { width: 5px; }
.ds-content-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.ds-content-inner {
    max-width: 680px;
    width: 100%;
    padding: 48px 40px 80px;
    margin: 0 auto;
}

.ds-close-area {
    width: 72px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 48px;
    gap: 8px;
}

.ds-close-btn {
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,255,255,0.15);
    color: var(--ds-text, #f2f3f5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.15s;
}

.ds-close-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.ds-esc-label {
    font-size: 0.65rem;
    color: var(--ds-muted, #949ba4);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ── Section titles ──────────────────────────────────── */
.ds-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ds-text, #f2f3f5);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.ds-card {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 16px;
    overflow: hidden;
}

.ds-field {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.ds-field:last-child { border-bottom: none; }

.ds-field-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ds-muted, #949ba4);
    margin-bottom: 6px;
}

.ds-field-value {
    font-size: 0.92rem;
    color: var(--ds-text, #f2f3f5);
    font-weight: 500;
}

.ds-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0,0,0,0.25);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: var(--ds-text, #f2f3f5);
    font-size: 0.92rem;
    transition: border-color 0.15s;
    outline: none;
    box-sizing: border-box;
}

.ds-input:focus {
    border-color: var(--primary-color, #5865F2);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb, 88,101,242), 0.2);
}

.ds-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

.ds-btn-primary {
    background: var(--primary-color, #5865F2);
    color: white;
}

.ds-btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.ds-btn-danger {
    background: rgba(220,53,69,0.15);
    color: #f23f43;
    border: 1px solid rgba(220,53,69,0.3);
}

.ds-btn-danger:hover {
    background: rgba(220,53,69,0.25);
}

.ds-btn-ghost {
    background: transparent;
    color: var(--ds-text-muted, #b5bac1);
    border: 1px solid rgba(255,255,255,0.12);
}

.ds-btn-ghost:hover {
    background: rgba(255,255,255,0.07);
    color: var(--ds-text, #f2f3f5);
}

/* ── Mi Cuenta — Profile preview card ───────────────── */
.ds-profile-preview {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 20px;
    background: var(--card-bg, #1e1e2a);
}

.ds-profile-banner {
    height: 140px;
    background: linear-gradient(135deg, #5865F2, #7289da);
    background-size: cover;
    background-position: center;
    position: relative;
    cursor: pointer;
}

.ds-profile-banner-edit {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 0.8rem;
    color: white;
    gap: 6px;
}

.ds-profile-banner:hover .ds-profile-banner-edit { opacity: 1; }

.ds-profile-avatar-wrap {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 0 16px;
    margin-top: -28px;
    position: relative;
    z-index: 1;
}

.ds-profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--card-bg, #1e1e2a);
    background: #2d2d2d;
    flex-shrink: 0;
}

.ds-profile-avatar-edit-btn {
    background: var(--primary-color, #5865F2);
    border: none;
    color: white;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 4px;
    transition: filter 0.15s;
}

.ds-profile-avatar-edit-btn:hover { filter: brightness(1.1); }

.ds-profile-preview-name {
    padding: 8px 16px 16px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--ds-text, #f2f3f5);
}

/* ── Tema / Apariencia ───────────────────────────────── */
.ds-theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.ds-theme-card {
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.ds-theme-card:hover { transform: translateY(-2px); }

.ds-theme-card.active { border-color: var(--primary-color, #5865F2); }

.ds-theme-preview {
    height: 60px;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 6px 8px;
    gap: 4px;
}

.ds-theme-bar { height: 6px; border-radius: 3px; opacity: 0.7; }

.ds-theme-label {
    padding: 6px 8px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(0,0,0,0.3);
    color: #f2f3f5;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Theme previews */
.ds-theme-midnight { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); }
.ds-theme-midnight .ds-theme-bar:nth-child(1) { background: #5865F2; width: 70%; }
.ds-theme-midnight .ds-theme-bar:nth-child(2) { background: rgba(255,255,255,0.15); width: 50%; }

.ds-theme-sunset { background: linear-gradient(135deg, #1a0a05 0%, #2d1206 100%); }
.ds-theme-sunset .ds-theme-bar:nth-child(1) { background: #e67e22; width: 70%; }
.ds-theme-sunset .ds-theme-bar:nth-child(2) { background: rgba(255,255,255,0.15); width: 50%; }

.ds-theme-very-dark { background: linear-gradient(135deg, #000 0%, #0d0d0d 100%); }
.ds-theme-very-dark .ds-theme-bar:nth-child(1) { background: #9b59b6; width: 70%; }
.ds-theme-very-dark .ds-theme-bar:nth-child(2) { background: rgba(255,255,255,0.1); width: 50%; }

.ds-theme-light { background: linear-gradient(135deg, #f0f2f5 0%, #ffffff 100%); }
.ds-theme-light .ds-theme-bar:nth-child(1) { background: #5865F2; width: 70%; }
.ds-theme-light .ds-theme-bar:nth-child(2) { background: rgba(0,0,0,0.12); width: 50%; }

/* ── Toggle switch ───────────────────────────────────── */
.ds-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.ds-toggle-row:last-child { border-bottom: none; }

.ds-toggle-info { flex: 1; }
.ds-toggle-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ds-text, #f2f3f5);
    margin-bottom: 2px;
}
.ds-toggle-desc {
    font-size: 0.75rem;
    color: var(--ds-muted, #949ba4);
}

.ds-toggle {
    width: 40px;
    height: 22px;
    background: rgba(255,255,255,0.15);
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
    border: none;
    outline: none;
}

.ds-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    transition: transform 0.2s;
}

.ds-toggle.on { background: var(--primary-color, #5865F2); }
.ds-toggle.on::after { transform: translateX(18px); }

/* ── Slider (font size, etc.) ────────────────────────── */
.ds-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.15);
    outline: none;
    cursor: pointer;
}

.ds-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color, #5865F2);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* ── Amigos ──────────────────────────────────────────── */
.ds-friends-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 0;
}

.ds-friends-tab {
    padding: 8px 14px;
    border-radius: 6px 6px 0 0;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--ds-muted, #949ba4);
    transition: all 0.15s;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.ds-friends-tab:hover { color: var(--ds-text, #f2f3f5); }
.ds-friends-tab.active {
    color: var(--primary-color, #5865F2);
    border-bottom-color: var(--primary-color, #5865F2);
}

.ds-friend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    transition: background 0.12s;
    cursor: pointer;
}

.ds-friend-item:hover { background: rgba(255,255,255,0.05); }

.ds-friend-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: #2d2d3a;
    flex-shrink: 0;
    position: relative;
}

.ds-friend-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(var(--primary-rgb,88,101,242),0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-color, #5865F2);
    flex-shrink: 0;
}

.ds-friend-info { flex: 1; min-width: 0; }
.ds-friend-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ds-text, #f2f3f5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ds-friend-status {
    font-size: 0.72rem;
    color: var(--ds-muted, #949ba4);
}

.ds-friend-actions { display: flex; gap: 6px; }

.ds-friend-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.08);
    color: var(--ds-text-muted, #b5bac1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.15s;
}

.ds-friend-btn:hover { background: rgba(255,255,255,0.15); color: white; }
.ds-friend-btn.accept:hover { background: rgba(35,165,89,0.3); color: #23a559; }
.ds-friend-btn.reject:hover { background: rgba(242,63,67,0.3); color: #f23f43; }

.ds-add-friend-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.ds-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 16px;
    color: var(--ds-muted, #949ba4);
    text-align: center;
}

.ds-empty-state i { font-size: 3rem; opacity: 0.3; }
.ds-empty-state p { font-size: 0.88rem; }

/* ─────────────────────────────────────────────────────────────
   PROFILE CARD POPUP (al hacer clic en avatar de comentario)
   ───────────────────────────────────────────────────────────── */

#profileCardPopup {
    position: fixed;
    z-index: 15000;
    width: 300px;
    background: var(--card-bg, #1e1e2a);
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    overflow: hidden;
    display: none;
    animation: popupAppear 0.2s cubic-bezier(0.34,1.3,0.64,1);
}

#profileCardPopup.visible { display: block; }

@keyframes popupAppear {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.pc-banner {
    height: 70px;
    background: linear-gradient(135deg, #5865F2, #7289da);
    background-size: cover;
    background-position: center;
    position: relative;
}

.pc-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.4);
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pc-close:hover { background: rgba(0,0,0,0.7); }

.pc-avatar-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0 14px;
    margin-top: -24px;
    position: relative;
    z-index: 2;
}

.pc-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--card-bg, #1e1e2a);
    background: #2d2d3a;
}

.pc-avatar-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(var(--primary-rgb,88,101,242),0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color,#5865F2);
    border: 4px solid var(--card-bg, #1e1e2a);
}

.pc-action-btns { display: flex; gap: 6px; margin-top: 28px; }

.pc-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.1);
    color: var(--text, #e0e0e0);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.15s;
}

.pc-action-btn:hover { background: rgba(255,255,255,0.2); }
.pc-action-btn.friend-added { background: rgba(35,165,89,0.2); color: #23a559; }

.pc-body { padding: 8px 14px 14px; }

.pc-username {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text, #f2f3f5);
    margin-bottom: 2px;
}

.pc-handle {
    font-size: 0.75rem;
    color: var(--ds-muted, #949ba4);
    margin-bottom: 10px;
}

.pc-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 10px 0;
}

.pc-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ds-muted, #949ba4);
    margin-bottom: 4px;
}

.pc-member-since {
    font-size: 0.8rem;
    color: var(--text, #e0e0e0);
}

.pc-msg-btn {
    width: 100%;
    margin-top: 12px;
    padding: 8px;
    background: var(--primary-color, #5865F2);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: filter 0.15s;
}

.pc-msg-btn:hover { filter: brightness(1.1); }

/* ─────────────────────────────────────────────────────────────
   EMOJI / STICKER PICKER
   ───────────────────────────────────────────────────────────── */

#emojiPicker {
    position: fixed;
    z-index: 14000;
    width: 360px;
    max-width: 95vw;
    height: 420px;
    background: var(--card-bg, #1e1e2a);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: popupAppear 0.18s ease;
}

#emojiPicker.ep-open { display: flex; }

.ep-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.15);
    padding: 0 8px;
    flex-shrink: 0;
}

.ep-tab {
    padding: 10px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--ds-muted, #949ba4);
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    border: none;
    background: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ep-tab:hover { color: var(--text, #f2f3f5); }
.ep-tab.active {
    color: var(--primary-color, #5865F2);
    border-bottom-color: var(--primary-color, #5865F2);
}

.ep-search {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.ep-search input {
    width: 100%;
    padding: 7px 10px;
    background: rgba(0,0,0,0.3);
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    color: var(--text, #f2f3f5);
    font-size: 0.85rem;
    outline: none;
    box-sizing: border-box;
}

.ep-search input:focus { border-color: var(--primary-color, #5865F2); }
.ep-search input::placeholder { color: rgba(255,255,255,0.3); }

.ep-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    scrollbar-width: thin;
}

.ep-body::-webkit-scrollbar { width: 3px; }
.ep-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.ep-category-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ds-muted, #949ba4);
    padding: 4px 4px 6px;
    margin-top: 8px;
}

.ep-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
}

.ep-grid.sticker-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.ep-item {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.3rem;
    transition: background 0.12s, transform 0.1s;
    background: none;
    border: none;
    color: inherit;
}

.ep-item:hover {
    background: rgba(255,255,255,0.12);
    transform: scale(1.15);
}

.ep-sticker-item {
    position: relative;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.15s, transform 0.15s;
    background: rgba(0,0,0,0.15);
    aspect-ratio: 1;
}

.ep-sticker-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.ep-sticker-item:hover {
    border-color: var(--primary-color, #5865F2);
    transform: scale(1.05);
}

.ep-sticker-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    font-size: 0.58rem;
    color: white;
    text-align: center;
    padding: 2px;
    opacity: 0;
    transition: opacity 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ep-sticker-item:hover .ep-sticker-name { opacity: 1; }

/* ── Preview tooltip ────────────────────────────────── */
.ep-preview {
    position: fixed;
    z-index: 15001;
    background: rgba(0,0,0,0.85);
    border-radius: 10px;
    padding: 8px 12px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
    max-width: 160px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.ep-preview.visible { display: flex; }

.ep-preview img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.ep-preview-name {
    font-size: 0.72rem;
    color: white;
    font-weight: 600;
}

/* ── Emoji en comentarios ────────────────────────────── */
.comment-sticker {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: block;
    margin: 4px 0;
    border-radius: 6px;
}

.comment-emoji-large {
    font-size: 1.8rem;
    line-height: 1;
}

/* ── Button para abrir el picker en el formulario ─────── */
.comment-picker-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--ds-muted, #949ba4);
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.comment-picker-btn:hover {
    background: rgba(var(--primary-rgb,88,101,242),0.15);
    border-color: var(--primary-color, #5865F2);
    color: var(--primary-color, #5865F2);
}

.comment-form-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

/* ─────────────────────────────────────────────────────────────
   DM (Mensajes Directos)
   ───────────────────────────────────────────────────────────── */

#dmOverlay {
    position: fixed;
    inset: 0;
    z-index: 13000;
    display: none;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#dmOverlay.dm-open { display: flex; }

.dm-window {
    width: 100%;
    max-width: 500px;
    height: 70vh;
    max-height: 600px;
    background: var(--card-bg, #1e1e2a);
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: popupAppear 0.2s ease;
}

.dm-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.15);
}

.dm-header-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: #2d2d3a;
}

.dm-header-name {
    font-weight: 700;
    color: var(--text, #f2f3f5);
    font-size: 0.92rem;
}

.dm-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--ds-muted, #949ba4);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    border-radius: 4px;
}

.dm-close:hover { color: var(--text, #f2f3f5); }

.dm-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
}

.dm-message {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.dm-message.own { flex-direction: row-reverse; }

.dm-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #2d2d3a;
}

.dm-msg-bubble {
    max-width: 70%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.4;
    background: rgba(255,255,255,0.08);
    color: var(--text, #e0e0e0);
}

.dm-message.own .dm-msg-bubble {
    background: rgba(var(--primary-rgb,88,101,242),0.25);
    color: var(--text, #f2f3f5);
}

.dm-input-bar {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.1);
}

.dm-input {
    flex: 1;
    padding: 9px 12px;
    background: rgba(0,0,0,0.3);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    color: var(--text, #f2f3f5);
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.15s;
}

.dm-input:focus { border-color: var(--primary-color, #5865F2); }

.dm-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color, #5865F2);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: filter 0.15s;
}

.dm-send-btn:hover { filter: brightness(1.1); }

/* ─────────────────────────────────────────────────────────────
   BANNER COLOR PICKER (en perfil editor)
   ───────────────────────────────────────────────────────────── */

.ds-banner-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.ds-banner-color {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.ds-banner-color:hover { transform: scale(1.2); }
.ds-banner-color.selected { border-color: white; transform: scale(1.15); }

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE MOBILE
   ───────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .ds-sidebar {
        width: 170px;
        min-width: 140px;
        padding: 12px 4px 0;
    }

    .ds-nav-item {
        font-size: 0.82rem;
        padding: 7px 8px;
    }

    .ds-content-inner {
        padding: 24px 16px 60px;
    }

    .ds-close-area { width: 44px; padding-top: 16px; }
    .ds-close-btn { width: 32px; height: 32px; font-size: 0.9rem; }
    .ds-esc-label { display: none; }

    .ds-theme-grid { grid-template-columns: 1fr 1fr; }

    #emojiPicker {
        width: 100vw;
        max-width: 100vw;
        left: 0 !important;
        right: 0;
        bottom: 70px !important;
        top: auto !important;
        border-radius: 12px 12px 0 0;
        height: 50vh;
    }

    #profileCardPopup { width: 280px; }
}

@media (max-width: 400px) {
    .ds-sidebar { display: none; }
    .ds-sidebar.mobile-open { display: flex; position: absolute; height: 100%; z-index: 2; }
    .ds-content-inner { padding: 16px 12px 60px; }
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE MOBILE — OVERRIDE COMPLETO
   ───────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    /* Panel pasa a columna: sidebar arriba como tabs */
    #discordSettings {
        flex-direction: column !important;
    }

    .ds-sidebar {
        width: 100% !important;
        min-width: unset !important;
        height: auto !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 0 !important;
        scrollbar-width: none !important;
        border-bottom: 1px solid rgba(255,255,255,0.07);
        flex-shrink: 0 !important;
    }

    .ds-sidebar::-webkit-scrollbar { display: none !important; }
    .ds-section-label { display: none !important; }
    .ds-nav-divider { display: none !important; }

    .ds-nav-item {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3px !important;
        padding: 8px 10px !important;
        font-size: 0.62rem !important;
        white-space: nowrap !important;
        border-radius: 0 !important;
        min-width: 52px !important;
        flex-shrink: 0 !important;
        border-bottom: 2px solid transparent !important;
        margin-bottom: 0 !important;
        text-align: center !important;
    }

    .ds-nav-item i {
        font-size: 1.1rem !important;
        width: auto !important;
    }

    .ds-nav-item.active {
        background: transparent !important;
        border-bottom-color: var(--primary-color, #5865F2) !important;
        color: var(--primary-color, #5865F2) !important;
    }

    .ds-user-panel {
        margin-top: 0 !important;
        border-top: none !important;
        border-left: 1px solid rgba(255,255,255,0.06);
        padding: 6px 10px !important;
        position: sticky !important;
        right: 0 !important;
        background: var(--card-bg, #2b2d31) !important;
        flex-shrink: 0 !important;
    }

    .ds-user-panel-info { display: none !important; }
    .ds-user-panel-logout { display: none !important; }

    .ds-content-wrap {
        flex: 1 !important;
        min-height: 0 !important;
    }

    .ds-content-inner {
        padding: 18px 14px 80px !important;
        max-width: 100% !important;
    }

    .ds-close-area { display: none !important; }
}

/* ── Botón cerrar flotante en móvil ── */
.ds-mobile-close {
    display: none;
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 12100;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    backdrop-filter: blur(4px);
}

@media (max-width: 640px) {
    .ds-mobile-close { display: flex !important; }
}

/* ── Profile section inline ── */
.ds-profile-inline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ds-profile-inline-banner {
    width: calc(100% + 80px);
    margin-left: -40px;
    margin-top: -48px;
    height: 190px;
    background-size: cover !important;
    background-position: center !important;
    border-radius: 0;
    position: relative;
    cursor: pointer;
    transition: filter 0.2s;
}

.ds-profile-inline-banner:hover::after {
    content: '✏️ Cambiar banner';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.45);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
}

.ds-profile-inline-avatar-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 0 16px;
    margin-top: -40px;
    position: relative;
    z-index: 2;
    margin-bottom: 12px;
}

.ds-profile-inline-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg, #1e1e2a);
    background: #2d2d2d;
    flex-shrink: 0;
    cursor: pointer;
    transition: filter 0.2s;
}

.ds-profile-inline-avatar:hover {
    filter: brightness(0.75);
}

.ds-profile-inline-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ds-text, #f2f3f5);
    padding-bottom: 8px;
}

/* Modal de selección de decoración/placa/efecto */
.ds-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 13000;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
    animation: dsFadeIn 0.2s ease;
}

.ds-picker-box {
    background: var(--card-bg, #2b2d31);
    border-radius: 14px;
    padding: 24px;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(255,255,255,0.1);
    scrollbar-width: thin;
}

.ds-picker-box::-webkit-scrollbar { width: 3px; }
.ds-picker-box::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 3px; }

.ds-picker-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ds-text, #f2f3f5);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ds-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.ds-picker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 4px;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s;
    background: rgba(255,255,255,0.04);
}

.ds-picker-item:hover {
    background: rgba(var(--primary-rgb, 88,101,242), 0.15);
    border-color: var(--primary-color, #5865F2);
}

.ds-picker-item.selected {
    border-color: var(--primary-color, #5865F2);
    background: rgba(var(--primary-rgb, 88,101,242), 0.2);
}

.ds-picker-item img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 6px;
}

.ds-picker-item-name {
    font-size: 0.65rem;
    color: var(--ds-muted, #949ba4);
    text-align: center;
    word-break: break-all;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ds-picker-none {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    transition: all 0.15s;
    font-size: 0.75rem;
    color: var(--ds-muted, #949ba4);
}

.ds-picker-none:hover,
.ds-picker-none.selected {
    border-color: var(--primary-color, #5865F2);
    color: var(--ds-text, #f2f3f5);
}

@media (max-width: 640px) {
    .ds-profile-inline-banner {
        width: calc(100% + 28px) !important;
        margin-left: -14px !important;
        margin-top: -18px !important;
        height: 140px !important;
    }

    .ds-picker-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
}

/* ─────────────────────────────────────────────────────────────
   FAQ (Soporte y Ayuda)
   ───────────────────────────────────────────────────────────── */

.ds-faq-item {
    border-bottom: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    transition: background 0.15s;
}

.ds-faq-item:last-child { border-bottom: none; }

.ds-faq-item:hover { background: rgba(255,255,255,0.03); }

.ds-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ds-text, #f2f3f5);
    user-select: none;
}

.ds-faq-chevron {
    font-size: 0.75rem;
    color: var(--ds-muted, #949ba4);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.ds-faq-answer {
    padding: 0 16px 14px;
    font-size: 0.85rem;
    color: var(--ds-muted, #949ba4);
    line-height: 1.6;
    animation: faqSlide 0.18s ease;
}

@keyframes faqSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────────────────────────
   SCROLLBAR TRACKS — quitar la barra blanca del sistema
   ───────────────────────────────────────────────────────────── */

::-webkit-scrollbar-track {
    background: transparent !important;
}

.ds-content-wrap::-webkit-scrollbar-track,
.ds-sidebar::-webkit-scrollbar-track,
.ds-picker-box::-webkit-scrollbar-track,
.ep-body::-webkit-scrollbar-track {
    background: transparent;
}

/* Scrollbar global de la app */
body::-webkit-scrollbar,
html::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* ─────────────────────────────────────────────────────────────
   AVATAR DECORATION — contenedor relativo en Mi Cuenta preview
   ───────────────────────────────────────────────────────────── */

/* El wrap de avatar en la preview de Mi Cuenta necesita que
   el primer hijo (div inline-flex) se vea correctamente */
.ds-profile-avatar-wrap > div[style*="inline-flex"] {
    position: relative;
    flex-shrink: 0;
}

/* Asegurar que la decoración de avatar en el inline profile (Perfil)
   se superponga correctamente al avatar */
.ds-profile-inline-avatar-row > div[style*="relative"] {
    display: inline-flex;
    flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────
   BARRA DE PROGRESO DEL LECTOR — ocultar cuando no está activo
   ───────────────────────────────────────────────────────────── */

#mangaReader:not(.show) .reader-progress {
    display: none !important;
}

/* ─────────────────────────────────────────────────────────────
   BOTÓN "VER PERFIL COMPLETO" en profile card
   ───────────────────────────────────────────────────────────── */

.pc-msg-btn + .pc-msg-btn {
    margin-top: 6px;
}

/* ============================================================
   DM: Burbuja con botón Responder + cita + barra reply
   ============================================================ */

/* Burbuja: mostrar botón reply en hover */
.dm-msg-bubble {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    word-break: break-word;
}

.dm-reply-btn {
    display: none;
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--ds-muted, #949ba4);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.72rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s, border-color 0.15s;
    line-height: 1;
}

.dm-reply-btn:hover {
    color: var(--ds-accent, #5865F2);
    border-color: var(--ds-accent, #5865F2);
}

.dm-message:hover .dm-reply-btn {
    display: inline-flex;
    align-items: center;
}

/* Timestamp del mensaje */
.dm-msg-time {
    font-size: 0.65rem;
    color: var(--ds-muted, #949ba4);
    margin-top: 2px;
    text-align: right;
}

.dm-message.own .dm-msg-time {
    text-align: right;
}

/* Cita del mensaje al que se responde */
.dm-reply-quote {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.06);
    border-left: 3px solid var(--ds-accent, #5865F2);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--ds-muted, #949ba4);
    margin-bottom: 4px;
    max-width: 100%;
    overflow: hidden;
}

.dm-reply-quote i {
    color: var(--ds-accent, #5865F2);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.dm-reply-author {
    font-weight: 700;
    color: var(--ds-accent, #5865F2);
    white-space: nowrap;
    flex-shrink: 0;
}

.dm-reply-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Barra de respuesta activa (encima del input) */
.dm-reply-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(var(--ds-accent-rgb, 88,101,242), 0.08);
    border-top: 1px solid rgba(var(--ds-accent-rgb, 88,101,242), 0.2);
    font-size: 0.78rem;
    color: var(--ds-muted, #949ba4);
    animation: slideUpQuick 0.15s ease;
}

@keyframes slideUpQuick {
    from { transform: translateY(4px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}

/* Spinner de carga (reutilizable en amigos y DMs) */
.ds-loading-spinner {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(var(--ds-accent-rgb, 88,101,242), 0.25);
    border-top-color: var(--ds-accent, #5865F2);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
