*{
    box-sizing:border-box;
}

body{
    margin:0;
    height:100vh;
    background:#121212;
    font-family:Arial, sans-serif;
    display:flex;
    flex-direction:column;
    color:#fff;
    overflow:hidden; /* 🔴 CLAVE: evita scroll general */
}

/* =========================
   HEADER
========================= */
.chat-header{
    display:flex;
    align-items:center;
    gap:12px;
    padding:12px 18px;
    background:linear-gradient(90deg,#b31217,#e52d27);
    font-weight:bold;
    font-size:18px;
    box-shadow:0 4px 10px rgba(0,0,0,.6);
}

.chat-logo{
    width:38px;
    height:38px;
    border-radius:50%;
    object-fit:cover;
    animation:heartbeat 1.5s infinite alternate;
    border:2px solid #000;
}

@keyframes heartbeat{
    from{transform:scale(1)}
    to{transform:scale(1.12)}
}

/* =========================
   CHAT CONTENEDOR
========================= */
#chat-container{
    flex:1;
    display:flex;
    flex-direction:column;
    padding:12px;
    min-height:0; /* importante para flex */
}

/* =========================
   CAJA MENSAJES
========================= */
#chat-box{
    flex:1;
    background:#1e1e1e;
    border-radius:12px;
    padding:12px;
    overflow-y:auto;
    box-shadow:inset 0 0 10px rgba(0,0,0,.7);
}

/* Scroll oscuro */
#chat-box::-webkit-scrollbar{
    width:8px;
}
#chat-box::-webkit-scrollbar-track{
    background:#121212;
}
#chat-box::-webkit-scrollbar-thumb{
    background:#444;
    border-radius:10px;
}
#chat-box::-webkit-scrollbar-thumb:hover{
    background:#666;
}

/* =========================
   FORM
========================= */
#chat-form{
    margin-top:10px;
    display:flex;
    flex-direction:column;
    gap:6px;
}

#chat-form input{
    background:#1a1a1a;
    border:1px solid #333;
    padding:10px;
    border-radius:8px;
    color:#fff;
}

/* =========================
   BOTONES
========================= */
.button-container{
    display:flex;
    gap:6px;
}

#chat-form button{
    flex:1;
    background:#2c2c2c;
    border:none;
    border-radius:8px;
    padding:10px;
    color:#fff;
    cursor:pointer;
    font-weight:bold;
}

#chat-form button:hover{
    background:#3a3a3a;
}

/* =========================
   MENSAJES SIMPLES (LEGACY)
========================= */
p{
    margin:6px 0;
    line-height:1.4;
}

.user-icon{
    background:linear-gradient(45deg,#ff3b3b,#c40000);
    color:transparent;
    -webkit-background-clip:text;
}

/* =========================
   MENSAJES NUEVOS
========================= */
.chat-message{
    display:flex;
    margin-bottom:10px;
}

/* ===== AVATAR ===== */
.avatar{
    width:36px;
    height:36px;
    border-radius:50%;
    color:#fff;
    font-weight:bold;
    display:flex;
    align-items:center;
    justify-content:center;
    margin-right:8px;
    flex-shrink:0;
}

/* ===== CONTENEDOR MENSAJE ===== */
.message-content{
    background:rgba(0,0,0,0.55);
    padding:8px 10px;
    border-radius:8px;
    max-width:80%;
}

/* ===== HEADER MENSAJE ===== */
.message-header{
    display:flex;
    justify-content:space-between;
    font-size:12px;
    margin-bottom:4px;
}

.user-name{
    font-family:'Roboto',sans-serif;
    font-weight:bold;
    color:#ffffff;
    margin-right:4px;
}

.chat-time{
    color:#dddddd;
    font-size:11px;
}

/* ===== TEXTO ===== */
.message-text{
    font-size:14px;
    color:#ffffff;
    word-wrap:break-word;
}

/* ===== SEPARADOR DE DIA ===== */
.day-separator{
    text-align:center;
    font-size:12px;
    color:#cccccc;
    margin:12px 0;
}

/* =========================
   RESPONSIVE
========================= */
@media(max-width:600px){
    .chat-header{
        font-size:16px;
    }
}

/* ===== ADMIN OFICIAL ===== */
.admin-badge{
    background:#1f2937;
    color:#fbbf24;
    font-size:10px;
    padding:2px 6px;
    border-radius:6px;
    margin-left:6px;
    font-weight:bold;
    letter-spacing:0.5px;
}

.chat-message .user-name strong{
    color:#fbbf24;
}