:root {
    --rucoy-blue: #3CBCFC;
    --rucoy-bg: #121212;
    --rucoy-drawer-bg: #2173b3;
    --white: #F3F3F3;
    --card-bg: rgba(255, 255, 255, 0.03); 
    --danger: #ff4d4d;
    --success: #2ecc71;
    --info: #3498db;
    --rucoy-green: #00ff41;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Roboto', sans-serif; }
body { background-color: var(--rucoy-bg); color: var(--white); overflow-x: hidden; }

/* --- TOP BAR --- */
header {
    background-color: var(--rucoy-blue);
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    position: fixed;
    top: 0; width: 100%;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.top-bar-action { display: flex; align-items: center; cursor: pointer; padding-right: 20px; }
.menu-btn img { width: 24px; filter: brightness(0) invert(1); margin-right: 15px; }
#current-page-title { font-size: 20px; font-weight: 500; }

/* --- DRAWER --- */
#drawer {
    position: fixed; top: 0; left: -280px; width: 280px; height: 100%;
    background-color: var(--rucoy-drawer-bg); z-index: 200;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); overflow-y: auto;
    display: flex;
    flex-direction: column;
}
#drawer.active { left: 0; }
.drawer-banner { width: 100%; height: 150px; background: url('/res/icon/draweBanner.png') center/cover; flex-shrink: 0; }
.drawer-list { list-style: none; padding: 8px 0; flex-grow: 1; display: flex; flex-direction: column; }
.drawer-item { padding: 12px 16px; display: flex; align-items: center; color: white; text-decoration: none; font-size: 16px; }
.drawer-item:hover { background-color: rgba(255, 255, 255, 0.1); }
.drawer-item img { width: 24px; margin-right: 32px; filter: brightness(0) invert(1); }

.settings-highlight {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #000000 !important;
    font-weight: bold;
}
.settings-highlight img { filter: brightness(0) !important; }

#overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: none; z-index: 150; }

/* --- PROFILE CONTENT --- */
main { padding: 76px 15px 20px 15px; max-width: 600px; margin: 0 auto; }

/* --- LISTA DE PERSONAGENS (ESTILO PÍLULA) --- */
.char-list { 
    margin-top: 35px; /* Espaço após o texto do topo */
    display: flex !important; /* Força o uso do flexbox */
    flex-direction: column !important;
    gap: 20px !important; /* Espaço aumentado entre os cards */
    padding-bottom: 30px;
}

.char-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    padding: 10px 25px;
    height: 60px;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    transition: 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    margin-bottom: 5px; /* Segurança caso o gap falhe */
}

.char-card:hover { 
    border-color: #ffffff; 
    background: rgba(255, 255, 255, 0.08);
}

.char-name { 
    font-size: 18px; 
    font-weight: bold; 
    color: var(--rucoy-green);
    text-transform: capitalize;
}

.char-actions-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-action {
    width: 38px;
    height: 38px;
    border-radius: 50%; 
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.btn-action img { width: 18px; height: 18px; filter: brightness(0) invert(1); }
.btn-action:active { transform: scale(0.9); }
.btn-action:hover { opacity: 0.85; }

.btn-view { background-color: var(--success); }
.btn-edit { background-color: var(--info); }
.btn-delete { background-color: var(--danger); }

/* --- BOTÃO DE ADICIONAR --- */
.add-char-container { margin-top: 25px; text-align: center; }
.btn-add {
    background: var(--rucoy-blue);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(60, 188, 252, 0.3);
}

/* --- MODAL FORM --- */
#modal-char {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); display: none; z-index: 300;
    align-items: center; justify-content: center; padding: 20px;
}
.modal-content {
    background: #252525;
    width: 100%;
    max-width: 400px;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #333;
}
.modal-content h2 { color: var(--rucoy-blue); margin-bottom: 20px; text-align: center; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 12px; color: #aaa; margin-bottom: 5px; }
.form-group input {
    width: 100%;
    padding: 12px;
    background: #121212;
    border: 1px solid #444;
    color: white;
    border-radius: 6px;
    outline: none;
}
.form-group input:focus { border-color: var(--rucoy-blue); }

.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn-save { background: var(--rucoy-blue); flex: 1; padding: 12px; border: none; border-radius: 6px; color: white; font-weight: bold; cursor: pointer; }
.btn-cancel { background: #444; padding: 12px 20px; border: none; border-radius: 6px; color: white; cursor: pointer; }

/* --- TOASTS --- */
.custom-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    z-index: 9999;
}
.success-toast { background-color: #2ecc71; }
.error-toast { background-color: #e74c3c; }


/* --- MODO APP (ESCONDER INTERFACE) --- */
body.is-app header, 
body.is-app #drawer, 
body.is-app #overlay {
    display: none !important;
}

body.is-app main {
    padding-top: 20px !important; /* Remove o espaço do header no App */
}

/* Ajuste para o scroll não bugar no mobile do App */
body.is-app {
    overflow-x: hidden;
}