/* Modales */
.modal-overlay-login {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}
.modal-overlay-login.activo { display: flex; }

.modal-contenido {
    background: linear-gradient(135deg, #2c1a1d 0%, #3a2125 100%);
    border: 3px solid #ffd700;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    position: relative;
}

.modal-contenido h2 { color: #ffd700; text-align: center; margin: 0 0 20px 0; }
.modal-input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    background: rgba(0,0,0,0.5);
    border: 2px solid #8B0000;
    border-radius: 8px;
    color: white;
    box-sizing: border-box;
}
.modal-boton {
    width: 100%;
    padding: 12px;
    background: #ffd700;
    color: #2c1a1d;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}
.modal-cerrar {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #8B0000;
    color: #ffd700;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
}
.modal-link { text-align: center; margin-top: 15px; color: #ffd700; cursor: pointer; }
.modal-error { color: #ff6666; text-align: center; margin: 10px 0; }

/* Panel usuario */
.usuario-panel {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0,0,0,0.5);
    padding: 5px 15px;
    border-radius: 30px;
}
.usuario-nombre { color: #ffd700; font-weight: bold; }
.btn-usuario {
    background: #8B0000;
    color: #ffd700;
    border: none;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
}

/* Secciones protegidas */
.seccion-protegida { display: none; }
.seccion-protegida.visible { display: block; }

/* Tómbola */
.tombola-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    overflow-x: auto;
    display: block;
}
.tombola-tabla th, .tombola-tabla td {
    border: 1px solid #8B0000;
    padding: 6px;
    text-align: center;
}
.tombola-checkbox { width: 18px; height: 18px; cursor: pointer; }
.btn-tombola {
    background: #ffd700;
    color: #2c1a1d;
    border: 1px solid #8B0000;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    margin: 2px;
}
.btn-peligro { background: #8B0000; color: #ffd700; }

/* Inventario */
.inventario-cuenta {
    border: 2px solid #8B0000;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}
.inventario-cuenta-header {
    background: #2c1a1d;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.inventario-personaje {
    background: rgba(0,0,0,0.2);
    padding: 12px;
    margin: 10px;
    border-radius: 8px;
    border-left: 3px solid #ffd700;
}
.busqueda-resultado {
    background: rgba(0,0,0,0.2);
    padding: 10px;
    margin: 10px 0;
    border-radius: 8px;
}

/* FORZAR VISIBILIDAD DE TÓMBOLA E INVENTARIO */
#tombolaSection,
#inventarioSection {
    background: linear-gradient(135deg, #2c1a1d 0%, #3a2125 100%) !important;
    color: #ffffff !important;
    border: 2px solid #ffd700 !important;
    border-radius: 15px !important;
    padding: 20px !important;
    margin: 20px 0 !important;
    
    visibility: visible !important;
    opacity: 1 !important;
}

#tombolaSection table,
#inventarioSection table {
    background: rgba(0, 0, 0, 0.3) !important;
    color: white !important;
}

#tombolaSection th,
#inventarioSection th {
    background: #8B0000 !important;
    color: #ffd700 !important;
}

#tombolaSection td,
#inventarioSection td {
    background: rgba(0, 0, 0, 0.5) !important;
    color: white !important;
    border: 1px solid #8B0000 !important;
}

.inventario-cuenta-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2c1a1d;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 5px;
}

.cuenta-titulo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.2s;
}

.inventario-cuenta-contenido {
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    margin-bottom: 15px;
}

.inventario-personaje {
    background: rgba(0,0,0,0.3);
    padding: 10px;
    margin: 8px 0;
    border-radius: 8px;
    border-left: 3px solid #ffd700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.inventario-personaje.coincidencia {
    background: rgba(255, 215, 0, 0.2);
    border-left-color: #ffaa00;
}

.personaje-info, .personaje-items, .personaje-botones {
    display: inline-flex;
    align-items: center;
}

.personaje-botones {
    gap: 5px;
}

.inventario-cuenta.tiene-coincidencias .inventario-cuenta-header {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid #ffd700;
}

@media (max-width: 768px) {
    .inventario-personaje {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .personaje-botones {
        align-self: flex-end;
    }
}

/* Estilos para inventario tipo acordeón */
.inventario-cuenta {
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
}

.inventario-cuenta-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2c1a1d;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #8B0000;
    transition: all 0.2s;
}

.inventario-cuenta-header:hover {
    border-color: #ffd700;
}

.cuenta-titulo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.2s;
    color: #ffd700;
}

.cuenta-botones {
    display: flex;
    gap: 5px;
}

.inventario-cuenta-contenido {
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 8px 8px;
    border-left: 1px solid #8B0000;
    border-right: 1px solid #8B0000;
    border-bottom: 1px solid #8B0000;
}

.inventario-personaje {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 15px;
    margin: 8px 0;
    border-radius: 8px;
    border-left: 3px solid #ffd700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.inventario-personaje:hover {
    background: rgba(0, 0, 0, 0.5);
}

.personaje-info, .personaje-items, .personaje-botones {
    display: flex;
    align-items: center;
}

.personaje-items small {
    color: #ccc;
    max-width: 300px;
    word-break: break-word;
}

.personaje-botones {
    gap: 5px;
}

.busqueda-resultado {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    margin: 5px 0;
    border-radius: 5px;
    border-left: 3px solid #ffd700;
}

/* Responsive */
@media (max-width: 768px) {
    .inventario-personaje {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .personaje-botones {
        align-self: flex-end;
    }
    
    .cuenta-botones {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}