/* =========================================================
   SISTEMA DE PERFIL E INSÍGNIAS (ESTILO DISCORD TRIPLE-A)
 ========================================================= */
.prf-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(10px);
    display: none; align-items: center; justify-content: center;
    z-index: 9999999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.prf-modal-overlay.prf-show {
    display: flex;
    animation: prfFadeIn 0.3s ease-out forwards;
}

@keyframes prfFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* CARTÃO DE VISUALIZAÇÃO DO PERFIL */
.prf-card {
    width: 360px; min-height: 480px; border-radius: 12px; overflow: visible; /* Visible para os tooltips saírem para fora */
    box-shadow: 0 25px 50px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,255,255,0.1);
    position: relative; transition: 0.3s;
    background: linear-gradient(135deg, var(--p-cor1, #1a1010), var(--p-cor2, #050505));
    display: flex; flex-direction: column;
}

.prf-banner {
    width: 100%; height: 140px; object-fit: cover;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    background: #000; flex-shrink: 0; border-radius: 12px 12px 0 0;
}

/* SISTEMA DE BROCHES / INSÍGNIAS */
.prf-insignia-bar {
    position: absolute; top: 10px; right: 15px;
    display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
    max-width: 200px; z-index: 20;
}

.prf-insignia {
    width: 32px; height: 32px; border-radius: 8px;
    background: rgba(10, 5, 15, 0.85); border: 1px solid #ffca28;
    display: flex; justify-content: center; align-items: center;
    cursor: help; position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.8), inset 0 0 8px rgba(255,202,40,0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(4px);
}
.prf-insignia:hover { transform: translateY(-4px) scale(1.1); border-color: #fff; box-shadow: 0 8px 15px rgba(0,0,0,0.9), 0 0 15px rgba(255,202,40,0.6); z-index: 30; }

.prf-insignia-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

/* TOOLTIP MÁGICO (O Cartãozinho que abre no Hover) */
.prf-tooltip {
    position: absolute; top: 40px; right: 0; width: max-content; max-width: 220px;
    background: rgba(5, 2, 8, 0.98); border: 1px solid #4a148c; border-radius: 6px;
    padding: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.9);
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: all 0.2s ease-in-out; pointer-events: none;
    text-align: left; z-index: 100;
}
.prf-insignia:hover .prf-tooltip { opacity: 1; visibility: visible; transform: translateY(0); }
.prf-tooltip h4 { margin: 0 0 5px 0; color: #ffca28; font-size: 13px; text-transform: uppercase; font-family: 'Georgia', serif; letter-spacing: 0.5px; border-bottom: 1px dashed #331244; padding-bottom: 4px; }
.prf-tooltip p { margin: 0; color: #d4c5b0; font-size: 11px; line-height: 1.5; font-family: sans-serif; }


.prf-body {
    flex: 1; padding: 20px; padding-top: 50px;
    background: rgba(10, 5, 10, 0.6); backdrop-filter: blur(20px);
    position: relative; display: flex; flex-direction: column;
    border-radius: 0 0 12px 12px;
}

.prf-avatar-wrap {
    position: absolute; top: -50px; left: 20px; width: 90px; height: 90px;
    border-radius: 50%; background: var(--p-cor1, #1a1010); padding: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.8); z-index: 10;
}
.prf-avatar-wrap img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid #000; }

.prf-badges { position: absolute; top: 15px; right: 20px; display: flex; gap: 5px; }
.prf-badge { background: rgba(0,0,0,0.6); padding: 4px 8px; border-radius: 4px; font-size: 11px; border: 1px solid rgba(255,255,255,0.2); color: #ffca28; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; }

.prf-name { margin: 0; color: #fff; font-size: 24px; font-family: var(--font-palatino, 'Georgia', serif); text-shadow: 1px 1px 3px #000; display:flex; align-items:center; gap: 10px;}
.prf-title { margin: 2px 0 15px 0; color: #aaa; font-size: 13px; font-weight: 500; }

.prf-bio-box {
    flex: 1; background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; padding: 15px; margin-bottom: 15px;
    color: #e0e0e0; font-size: 14px; line-height: 1.6;
    max-height: 160px; overflow-y: auto; font-family: 'Georgia', serif;
}

.prf-btn-edit { width: 100%; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 10px; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s; text-transform: uppercase; font-size: 12px; letter-spacing: 1px; display: none; }
.prf-btn-edit:hover { background: rgba(255,255,255,0.2); box-shadow: 0 0 10px rgba(255,255,255,0.1); }

.prf-btn-close { position: absolute; top: -40px; right: 0; background: transparent; border: none; color: #aaa; font-size: 30px; cursor: pointer; transition: 0.2s; }
.prf-btn-close:hover { color: #fff; transform: scale(1.1); }

/* =========================================================
   MODAL DE EDIÇÃO DE PERFIL
========================================================= */
.prf-edit-box {
    background: #0a050d; border: 2px solid #4a148c; border-radius: 8px;
    padding: 25px; width: 95%; max-width: 600px; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.9), inset 0 0 30px rgba(74, 20, 140, 0.2);
}
.prf-edit-box h2 { color: #e1bee7; margin: 0 0 20px 0; font-family: var(--font-palatino, serif); border-bottom: 1px dashed #4a148c; padding-bottom: 10px; text-transform: uppercase; letter-spacing: 1px;}
.prf-edit-box h4 { color: #ffca28; margin: 25px 0 15px 0; font-family: sans-serif; border-bottom: 1px solid #331244; padding-bottom: 5px; text-transform: uppercase; font-size: 13px;}

.prf-label { display: block; color: #b388ff; font-size: 11px; font-weight: bold; text-transform: uppercase; margin-bottom: 5px; margin-top: 15px;}
.prf-input { width: 100%; background: rgba(0,0,0,0.6); color: #fff; border: 1px solid #331244; padding: 10px; border-radius: 4px; box-sizing: border-box; transition: 0.3s; font-family: sans-serif;}
.prf-input:focus { border-color: #e1bee7; outline: none; box-shadow: inset 0 0 5px rgba(156, 39, 176, 0.5); }

.prf-colors { display: flex; gap: 15px; }
.prf-color-wrap { flex: 1; display: flex; flex-direction: column; }
.prf-color-input { width: 100%; height: 40px; border: 1px solid #331244; border-radius: 4px; cursor: pointer; padding: 0; background: #000; }

.prf-insignia-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px;
    background: rgba(20, 5, 25, 0.5); padding: 15px; border-radius: 6px; border: 1px solid #331244;
}
.prf-insignia-item { display: flex; flex-direction: column; }

.prf-edit-btns { display: flex; gap: 10px; margin-top: 25px; position: sticky; bottom: -25px; background: #0a050d; padding: 15px 0; border-top: 1px solid #331244; z-index: 10;}
.prf-btn-save { flex: 2; background: linear-gradient(135deg, #4a148c, #7b1fa2); border: 1px solid #9c27b0; color: #fff; padding: 12px; border-radius: 4px; font-weight: bold; cursor: pointer; transition: 0.2s; text-transform: uppercase; letter-spacing: 1px;}
.prf-btn-save:hover { box-shadow: 0 0 15px rgba(156, 39, 176, 0.6); }
.prf-btn-cancel { flex: 1; background: #111; border: 1px solid #444; color: #aaa; padding: 12px; border-radius: 4px; font-weight: bold; cursor: pointer; transition: 0.2s; text-transform: uppercase;}
.prf-btn-cancel:hover { background: #222; color: #fff; }

/* =========================================================
   UTILITIES E REGRAS DE LAYOUT (SEPARADAS DE INLINE CSS)
========================================================= */
.prf-relative { position: relative; }
.prf-label-no-margin { margin-top: 0 !important; }
.prf-flex-row-gap { display: flex; gap: 10px; }
.prf-flex-1 { flex: 1; }
.prf-edit-subinfo { color: #aaa; font-size: 11px; margin-top: -10px; margin-bottom: 10px; }

.prf-insignia-select-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.prf-insignia-preview {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #331244;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.8);
}

.prf-preview-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.prf-show {
    display: flex !important;
}

.prf-show-inline {
    display: block !important;
}

.prf-hidden {
    display: none !important;
}

.prf-badge-master {
    color: #ffca28 !important;
    border-color: #ffca28 !important;
}